Showing results for 
Search instead for 
Did you mean: 

How to input data from Excel in a Labview table?


I am looking for a solution to input data from excel to a table in Labview OR how can I use copy and paste to insert data in a Labview table. Can it be done?

For example - I'm trying to input some data (let's say I have 3 variables a, b, and c) and do some calculations; the output are other values, let's say x, y, z. I would like to have the input from a table and the output should result in a table also. I can further send the output table to excel and I believe Labview has a good example about this. However, Labview does not have any example on how to INPUT a table from excel. Or, let'say you do some calculations in excel and you have a table of 100 lines and 3 columns (a, b, c). It would be annoyng and time consuming to input value by value in an Labview array or table all the cells. Apparently copy and paste does not work for Labview arrays and tables. Or, am I wrong; what would be a good solution to enter more data at one time?

Any examples would be greatly appreciated.

Thank you.
0 Kudos
Message 1 of 18

A solution I think is easy is to save the excell sheet as a text file (csv of tab separating values) and then use the function Read From Spreadsheet File in LabVIEW to read the data.

Hop this helps,
Message 2 of 18
Thank you Paulo. This sounds like a decent solution.

I am still looking for a solution to copy and paste data from excel or other similar software (for example Minitab) to a table (or whatever) in Labview.
0 Kudos
Message 3 of 18
You can use ActiveX methods to get data directly from Excel into LV, but it won't be as simple as reading from the tab delimited text file. Search the example finder (Help>>Find Examples) for Excel and you will find examples for talking to Excel.

Try to take over the world!
Message 4 of 18
Thank you.

I find extremely annoying the fact that you cannot really copy and paste data (numbers) in a table or array.
I know nothing about ActiveX but I will look into it.

Does anybody knows what can I use to acess database files and extract data that I can further use in calculations? Any examples?
0 Kudos
Message 5 of 18

I found this someplace and it works for me.

Message 6 of 18

Thank you. The example is excellent.
However, for some files works for other doesn't work (nothing is displayed). Nevertheless it could be useful for what I am trying to do.

Thanks again.
0 Kudos
Message 7 of 18

In the "For loop", be sure the SheetName matches the name of the sheet you want to read from the Excel file.

In the "input cluster" is where you set the StartRow, StartColumn, EndRow, and EndColumn of the sheet you want to read. (Cell A1 = 0,0).

0 Kudos
Message 8 of 18

I followed your advice. The same thing happens.
It appears this is happening only for the excel files that have more than 1 worksheets. Apparently the vi can read only one spreadsheet in a file. What is even more intriguing is that even if I close the application and excel, if I restart the application and or excel and try to reopen the file a message tells me that the file is already ove and if I want to overwrite...
It would be neat to make the read-excel-file vi identify the other spreadsheets also and ask you which one you want to read. I believe this would imply adding in the input cluster one more case for spreadsheet but I'm not shure what the other connections will look like. Any way, before doing anything else I'll have to restart my computer to close those background running excel files 🙂
0 Kudos
Message 9 of 18
Here is a small utility that can be used to copy and paste between a table and Excel.
I have been obliged to slice the llb into small chuncks for internet technical issues. Sorry...


Message Edited by chilly charly on 04-02-2005 03:21 PM

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
Download All
Message 10 of 18