From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read all string from this spreadsheet file?

How can I read all strings from this spreadsheet. Where can I find any example code? I tried some, but seems that doesn't work.

Thanks.

Merry Christmas!
0 Kudos
Message 1 of 10
(3,393 Views)
Which one ?
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 2 of 10
(3,375 Views)
Can you provide the spreadsheet?
Message 3 of 10
(3,369 Views)
Sorry, I thought I have attached the file.
0 Kudos
Message 4 of 10
(3,362 Views)
You can use the Open Spreadsheet File.vi
Use the Context Help as a starting point. Which version of LV are you using? If it is 7.0, then you can use the example finder located within the Help menu.
Message 5 of 10
(3,357 Views)
No way you could use "Read from spredsheet", since your file is a native format Excel file.
You can download a solution ready-to-use from here

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 6 of 10
(3,343 Views)
Another option would be to save your Excel file to a .csv file. You can do this from Excel from the "save as" menu. Once the file is in this format, you can use the "read characters from file.vi" and the "convert from spreadsheet string" function to get your data in a 2D array of strings format.
0 Kudos
Message 7 of 10
(3,312 Views)
Try this vi. You have to put in the file name and the range of cells you want to sample.

Hope this works for you. It uses ActiveX calls to get the data from the application. You may have to relink the Automation references to point to your Excel program.
Randall Pursley
0 Kudos
Message 8 of 10
(3,305 Views)
Thanks for all of your responses.

I could read from excel file now. My application is read data from Corel Quattro Pro, which is a spreadsheet file (*.wb3 file), similar with Excel. But seems it doesn't have activex function.
If I right click the automation reference in front panel in a Labview program then click "Select ActiveX class", then browse, are all activex application in that library? There is no Corel Quattro Pro there, So I can not link Labview to it. Am I right?

I tried to open and read from file then convert spreadsheet string to array, but I got very strange code.

What's the solution in this situation?

Thanks.
0 Kudos
Message 9 of 10
(3,282 Views)
Quattro Pro is a very old program. No longer sold and it's certainly possible that it never had ActiveX support. The easiest thing to do is to do a save as and pick a text file format. You can then use Read From Spreadsheet file to read from a comma or tab separated file. Trying to read a native file format is usually a waste of time because of all of the special control characters for formatting that are embedded in the file.
0 Kudos
Message 10 of 10
(3,277 Views)