ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView and excel workbook find value problem

Ok I have banged my head against the wall enough I must be missing something. I am trying to open an excel workbook go to a specific sheet find a value and insert a different value in the same row but a different column. I can do this for the most part, where I run into a problem is if the value that I am searching for is placed in the worksheet I am searching via a formula. I get an error. Here is a quick excel workbook and part of the VI that I am working on that is having the problem. Hopefully someone can see where I am going wrong. This VI is in LabView 7 and I am using office 2000. The sheet I am searching is test sheet.

Thanks
-D
Download All
0 Kudos
Message 1 of 9
(4,282 Views)
Wire numerical "2" to the "LookAt" input of the Find method.

-Joe
Message 2 of 9
(4,282 Views)
Thanks for your quick answer Joe. I tired what you mentioned and if i did it correctly I am still having the same problem. I have attached the modified vi.

Thanks
Dave
0 Kudos
Message 3 of 9
(4,282 Views)
If you receive error 97, then it means the search found nothing (labview therefore can not generate a valid reference). In this case, check the Find ref value using "NaN/Path/Num.vi" right after the "Find", when true, skip the next step.

-Joe
0 Kudos
Message 4 of 9
(4,282 Views)
Joe

I appreciate your patience and help this is the first time that I am trying to work between LabView and Excel.

Error 97 is the problem I am having now, after wiring a �2� to the LookAt input of the find, but the value I am searching for is in the workbook and on that sheet. I think the issue is somehow that the value is placed there via a reference to another page so the cell with the value contains a reference i.e.� =Sheet3!G18� but displays the value I am searching for. If I remove the reference and write the value in the cell I find it ok, otherwise I get an invalid refnum. I tired wiring the LookIn input of the find to look just at the values which is the same way it needs to be searched within Excel. I then come up wi
th error -2147352571. I tried setting the LookIn by trying values of xlValues, various numbers, Values, xlValue, and Value but none of these seemed to work. I know in writing a Macro it would be �Lookin:=xlValues�.


Thanks
Dave
0 Kudos
Message 5 of 9
(4,283 Views)
please check the attached image, and pay close attention to the circled parts.

-Joe
0 Kudos
Message 6 of 9
(4,282 Views)
Thanks Joe that worked great. I really appreciate your help. One question out of curiosity the value FFFFEFBD that is wired to the LookIn input how did you determine that and what is it�s meaning?

Thanks again for your help and patience

Dave
0 Kudos
Message 7 of 9
(4,282 Views)
I have a book (sorry, can't recall the name) which lists all the constant values, but here is a webpage.

http://www.geocities.com/ResearchTriangle/9834/msexcel8.htm

or, you can go into VBA editor in Excel put this piece of code in there:

sub test()
debug.print xlValues
end sub

Press F5 to run it. The result will be shown in the immediate window (CTRL+G). In this case, it is a negative value.

-Joe
0 Kudos
Message 8 of 9
(4,282 Views)
drhovasse,
Can you please post the final version of this functionality so I can compare between the previous two versions you posted? I may need this in my application. Thanks!
0 Kudos
Message 9 of 9
(4,253 Views)