Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel: Error in cells
Message
 
 
To
16/01/2010 14:21:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01444331
Message ID:
01444345
Views:
77
This message has been marked as the solution to the initial question of the thread.
See <B>Re: Querying #N/A Values</B> Thread #1168024 Message #1168287

>Thanks, but I don't quite understand how the syntax would be for automation (from Visual FoxPro).
>
>IF loSheet.Cells(row, col).IsError() looks wrong, since this is a function, not a method.
>
>>Check Excel IsError() function.
>>
>>>When I try to get a value of a cell in an Excel spreadsheet, it must have been either with loSheet.Cells(lnRow, lnCol).Value or with loSheet.Cells(lnRow, lnCol), I sometimes get an error message. I noticed that this happens when Excel shows an error message, e.g., for an unknown formula.
>>>
>>>I tried something with TRY / CATCH, providing a default value in case of an error. Something like this:
>>>
>>>
>>>TRY
>>>  lcValue = loSheet.Cells(lnRow, lnCol)
>>>CATCH
>>>  lcValue = ""
>>>ENDTRY
>>>
>>>
>>>This works fine, however, I was wondering whether this was the correct approach. For example, is there a way to check the cell for an error without using a TRY...CATCH?
>>>
>>>TIA,
>>>
>>>Hilmar.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform