Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test for #### in Excel
Message
From
20/02/2007 07:13:58
 
 
To
20/02/2007 06:01:58
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01197204
Message ID:
01197212
Views:
11
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform