LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read a range of data from an open and "live" Excel file using LV7.0 Express

I need to interface with software which continuously (once per second) writes a new array to a fixed location in an open Excel file. I would like to read this data into Labview from where I can do what I like with it. I am relatively new to LabView and have tried all "Read Data" examples that come with the product, Active examples seem very unclear. Anyone got any samples/suggestions to get me started?
0 Kudos
Message 1 of 2
(2,590 Views)
It is possible but might be a little bit complicated. Does your application opens the Excel file or Excel file was opened through Excel or another application already?

In the first senario, once the excel is opened, start reading the data, do not close the report file (dispose the report) or close the excel file

In the second senario, it is a little bit more complicated. You need to use low level Excel ActiveX functions. The procedure is:
1. Open reference to Excel
2. Activate the desired workbook if it is already opened
or open a new file
3. Activate the sheet containing the data
4. Read the data
5. Loop if necessary (step 2 if diff wb, step 3 if diff sht, 4 if same sheet)
6. Close Excel reference (Very important, close the
ref only, do not use Application.Exit to exit Excel).

Hope this helps,

-Joe
Message 2 of 2
(2,590 Views)