LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read xls

I need VI that can read excel file ( e.g file contain two columns(or more) with ID and GRADES ) and put this data into 2D array
Smiley Sad
Thank You

Message Edited by eruvi on 01-23-2006 04:11 AM

Message Edited by eruvi on 01-23-2006 04:11 AM

0 Kudos
Message 1 of 24
(5,220 Views)
Hi, Eruvi:

If you have the "Report Generation Toolkit" Add-on, you can use "Excel Get Data" vi to get any data in an Excel file.

If you don't have the "Report Generation Toolkit" Add-on, you can

1.- do the same thing using ActiveX and making your own "Excel Get Data"

Or

2.- saving your Excel file in CSV format (comma separated values) and reading it as a text file.

Hope it helps,
Aitortxo.
0 Kudos
Message 2 of 24
(5,209 Views)
Hiiii, Aitortxo
 
                    I also require the same problem as Eruvi, i also want to read the file from the excel and i want to read it continuosly, i have the add package excel setup, in which there are certain file are there in the lib file, but none of them are executable, i am posting here those vis, can u explain me why there are errors in it?
 
                  Another thing is i want the continuos data, mean suppose i ve 40,000 rows in the excel sheet, then how can i read it, so that data comes continuosly instead of once data comes and stop the execution, pls.. suggest me something.
 
Anybody is invited for the suggesion. Thanks in Advance.
 
Thank you,
Rujuta

Message Edited by Ruju on 01-23-2006 05:00 AM

0 Kudos
Message 3 of 24
(5,206 Views)
Hi, Ruju

The "Read Excel Data" VI has an input where you tell which cell you are asking data. You can insert "Read Excel Data" in a FOR loop so that you generate the excell cells you need.

If you know how many cells there are in your excel file, you can use a FOR. If you don't know, you can use a while loop and check if there is any data to terminate the loop.

Hope it helps,

P.D. In order to execute your LLB's functions, you need
these files
subvis\
error Merging.vi
subvis\
_excelsup.llb
Check for used LV version.vi
calculate location.vi
Aitortxo.
0 Kudos
Message 4 of 24
(5,193 Views)
Hi Aitortxo
 
First I want to thank you for your response
 
I don't have the "Report Generation Toolkit" Add-on and I really new user ( last week I finished "Basic I"
NI course ) so ActiveX is advanced for me....
 
Could you please send me example VI ,I'll really appreciate that..
 
Thank you in advance
 
Eruvi
0 Kudos
Message 5 of 24
(5,184 Views)
The easiest thing for you to do is save the Excel spreadsheet as a comma or tab separated text file and use the Read From Spreadsheet function on the File I/O palette. For ActiveX examples, all you have to do is search the LabVIEW forum. One thing to be aware of with the ActiveX examples is that success on using them depends on which version of Excel you have and which version of Excel the example was written for.
0 Kudos
Message 6 of 24
(5,172 Views)

Hi Dennis

Can I do this saving using LabView VI?

Thank you in advance

 

0 Kudos
Message 7 of 24
(5,137 Views)
Sure, but you're back to using ActiveX again in order to control Excel.
0 Kudos
Message 8 of 24
(5,110 Views)

Hi All,

I wrote an example a while back to do this. You can read either a single cell or a range. You can also specify whether to convert the data to string or double precision numeric. This should be a good beginner for using ActiveX with LabVIEW.

The example was written in LabVIEW 7.1. Also note that the example was written to be completely modular, meaning you can iterate certain functions. The functions include opening an instance of Excel, a Workbook, a specific Worksheet (by name or number), then reading certain ranges. You could, for instance, modify this to open Excel and then read multiple separate workbooks or worksheets. You can also unbundle the cluster of references if you wanted to add functionality such as writing data to a specific spreadsheet. Hope this helps!

Message Edited by Jarrod S. on 01-24-2006 11:03 AM

Jarrod S.
National Instruments
Message 9 of 24
(5,145 Views)

Hiiii, Jarrod,

           I havent check the output yet, but thanks anyways..., but i wnat to ask you that,as u wrote that u ve made the example and u ve send me the .llb file, so i want to ask you that, how you are creating llb file from vi files...? can you explain me method for it?

Thank you,

Rujuta

0 Kudos
Message 10 of 24
(5,126 Views)