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--