LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read data from excel and put in array?

Mike,

The spreadsheet that you are trying to read is it a *.xls meaning is it saved in the proprietary format of excel or is it just a tab delimited file. If it is a *.xls file you can use the examples and toolkits on the excel board to help you out tremendously. If it is just a tab delimited file just use the regular read from spreadsheet file VI's.

The trick is when working with excel specific files you must use Active X. You need to go through some examples and learn how to use it. (it is very cumbersome).

there are a few examples in the example finder and there are some good toolkits on this site that are free.

For more information and some sample VI's and tool kits, you can go to the excel board




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 11 of 12
(3,999 Views)
Hi Mike,
 
I agree with with the suggestions that others have posted here. Essentially, there are two ways to interact with an Excel file (*.xls) in LabVIEW. The first (easy) method is to use the Report Generation Toolkit; which adds many Excel specific VIs that you can use to open, manipulate, and close Excel files.
 
The second (difficult) method is to use ActiveX commands to programatically interface with the Excel application. To get started, you can open up the Example Finder located in LabVIEW under Help >> Find Examples. From there, select Communicating with External Applications >> ActiveX >> Excel for a few examples of LabVIEW / Excel interaction. This is essentially what is going on behind the scenes of the Report Generation Toolkit, only in this case you have to manually call the ActiveX properties and methods in order to write your application.
 
Keep in mind that the simplest way to read and write data in LabVIEW is using the File I/O functions. If it is possible for you to export your Excel data to a text file (even by copying and pasting data), you will have a much easier time reading in that data in LabVIEW.
 
I hope this helps, have a great day Mike!
 
Casey Weltzin
Applications Engineer
National Instruments
0 Kudos
Message 12 of 12
(3,985 Views)