LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find a string inside Excel table

Hi,
 
I am trying to find a string inside Excel table, and it does not work. Please see attached figure. I use the find Invoke Node and do not get anthing.
 
Please help
0 Kudos
Message 1 of 6
(3,893 Views)
Hi,
 
Do you not get anything the Variant indicator?  Any errors?
 
-Khalid
0 Kudos
Message 2 of 6
(3,885 Views)

The variant indictor has nothing and I get error 97 (Unknown System Error in Read_XL.vi). The error is generated at the end of Range->Value2.

 

0 Kudos
Message 3 of 6
(3,884 Views)

Error 97 is when a Null Refnum is passed in as input.  So, make sure your reference is valid throughout the chai of property/method nodes. 

Also, can you attach the VI?

-Khalid

0 Kudos
Message 4 of 6
(3,882 Views)
See attached files.
 
Thanks,
David
 
Download All
0 Kudos
Message 5 of 6
(3,872 Views)

The reason for your error is that the search range you are specifying is too narrow. Currently, your search range is set to stop on the 5th row of the worksheet, but the cell that contains the string you are searching for is located on the 6th row. When the Range.Find method doesn't find a match, it returns an invalid reference, which gets passed to the next invoke node and causes this error. Expand your search range to 6 rows, and everything should work just fine. Moreover, you should build some programmatic logic in your VI to handle the case of the search finding no matches so that you can prevent that case from causing an error and taking down the rest of your program.

Kind Regards,

E. Sulzer
Applications Engineer
National Instruments
Message 6 of 6
(3,853 Views)