LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from Excel

Hi,

I'm trying to write a vi that will read from Excel. I use LV 6.1 (stuck in past). I've downloaded examples that demonstrate how to write to excel but as of yet have been unable to locate any 6.1 examples that show how to read from excel. Could someone point me in right direction?
0 Kudos
Message 1 of 6
(3,783 Views)

What are you trying to read from excel?  You should be able to communicate directly with excel using an activeX reference, then use excel's properties and methods to do almost anything.  You can also just read data from a tab delimited text file and skip excel.  A few details on what you need to do will help determine how to do it.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 6
(3,773 Views)
In the File I/O(block dig) you can use the "read from spreadsheet"vi...it will read that file,
 
hope that helps.
 
Bunny
0 Kudos
Message 3 of 6
(3,772 Views)
Here are some VI's that will help you with excel



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 6
(3,767 Views)

hi,

i need to read excel sheet row by row, that is the whole row at a time and at the same time i need to write this row into the text file

can you help me to do this?

regards,

Raghu

0 Kudos
Message 5 of 6
(3,170 Views)
Hi Raghu,

You have a wide variety of options in terms of how to read the data from excel and later write it out to a text file.  Before we dive into those, however, I assume that you will be doing more than just reformatting the excel file into a text file  (i.e., selecting only particular rows to write, performing some kind of operation on the data, etc).  If not, you might consider just having LabVIEW make an ActiveX call to Excel to save a copy of the workbook as a text file.

Within LabVIEW, probably the simplest way to read in the data is using the Read From Spreadsheet File VI, located on the File I/O palette.  This will let you pull in as many rows of data at a time as you like, or even all rows in the file at once as a 2-dimensional array.  Either way, you can then process the data in your VI and when you are ready, you can use one of the several file output VI's to write the data to your second file.  If you're working with array data and you need the file to be human-readable (i.e., a text file), I recommend the Write to Spreadsheet File, also located on the File I/O palette. 



Message Edited by MattP on 03-06-2007 03:22 PM

Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 6 of 6
(3,133 Views)