Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for #### in Excel
Message
 
 
À
20/02/2007 06:01:58
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01197204
Message ID:
01197212
Vues:
12
>Hi Guys,
>
>When a figure does not fit in a column, Excel displays it in form of hashes (something like ######). When Automating, is there a way to test for a cell of this nature ? The AUTOFIT function can be used to display everything but in some cases AUTOFIT exagerates the width especially if a long title exists.
>
>Please help
>
>
>Fred Matano Kotte

Here is what I tried once to solve similar problem:
for lnI = 1 to m.lnCols
					.Cells(1,laFieldNames[m.lnI,3]).value = laFieldNames[m.lnI,1]
					.columns[m.lnI].EntireColumn.autofit()
*!*						if ' date ' $ " " + lower(laFieldNames[m.lnI,2]) + " " && date field
*!*							loRange = .UsedRange.Offset(2) && we don't want to apply format for header row
*!*							loRange.columns[m.lnI].NumberFormat = "mm/dd/yyyy"
*!*	                    endif
					try
** To make sure long descriptions fit
						if 	.columns[m.lnI].columnwidth > 15
							.columns[m.lnI].columnwidth = 240
						else
							.columns[m.lnI].columnwidth = 15
						endif
					catch to loRangeProblem
* Let's ignore this error with the range and column width
						lcMsg = Log_Error(m.loRangeProblem)
					endtry
				next
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform