Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel: Error in cells
Message
 
 
À
16/01/2010 14:21:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01444331
Message ID:
01444345
Vues:
76
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform