05-31-2007 09:57 AM
Hello,
I need to open a spreadsheet file, search for a particular value( part number ), return the line number (column number?), then load that entire row into CVI where I will pick off pertinent items from the row.
I’ve considered reading the entire spreadsheet into a table or some other element, then do the search, however, I’m reluctant due to the spreadsheet size.
Would I load the spreadsheet into a table? Load it into a structure?
I’m quite new at using C and of course CVI. Can anyone give me some tips or help on doing this?
Thank you,
Randy
06-01-2007 03:20 AM - edited 06-01-2007 03:20 AM
Message Edited by ebalci on 06-01-2007 11:22 AM
06-05-2007 10:40 AM
06-06-2007 12:04 AM
Hi Randy,
The sheet name matters of course.
If you did not use GetWorksheetFromIndex or GetWorksheetFromName to get a handle to your worksheet the find function (or any other function requiring a worksheet handle) won't work.
You can use "Sheet2" in the second function above to get a valid handle.
Besides, I see that you entered ExRConst_dataEmpty in the second parameter and &FindThis in the third.
If you want to find empty cells the search data probably will be ignored and you may get a correct answer, but I really wonder how you defined FindThis in your code.
If it is something like char FindThis[10]; then you should not put an '&' before its name because it would already be a pointer.
Hope this helps.