Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with columns with long info in Excel
Message
De
08/09/2006 04:57:45
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01152063
Message ID:
01152188
Vues:
27
>Hi everybody,
>
>I'm trying to convert Excel file into DBF. I'm using fSplitIntoDBF function which is my modification of my colleague's code. I have a problem with columns that have long info (less than 255 chars, though). I'm trying this code:
>
>for lnI = 1 to m.lnCols
>   .Cells(1,laFieldNames[m.lnI,3]).value = laFieldNames[m.lnI,1]
>   .columns[m.lnI].autofit()
>   try
>	if .columns[m.lnI].columnwidth < 50
>** To make sure long descriptions fit
>	.columns[m.lnI].columnwidth = .columns[m.lnI].columnwidth * 5	
>
>         endif
>   catch to loRangeProblem
>* Let's ignore this error with the range and column width
>   endtry
>next
For what it is worth

(1) You do the autofit after all rows have been filled out, I take it

(2) I'm using another 'autofit'. Do not know whether it makes a difference
xlSheet.PageSetup.PrintTitleRows = "$1:$1"
for i = 1 to m.ncols

 =m.xlSheet.Columns(m.i).EntireColumn.AutoFit
endfor
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform