LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read data from and write data to excel... HOW?

I downloaded the 30 day trial of the MS Office toolkit in hopes that I can find a way to put data into an existing Excel file and read data out of that same file. I've been reading the help files and I'm lost. I want to do something REALLY simple, which is write a column of data from my vi into an existing Excel spreadsheet at a designated beginning row & column, then read 1 cell back into my vi from a designated cell reference. Nowhere in all the help files do I see a way to provide a file name and path for the existing spreadsheet. I'm VERY proficient with Excel, but this toolkit, help files and the vi's provided are very confusing.

0 Kudos
Message 1 of 8
(3,869 Views)

This should be posted to the LabVIEW forum. This is a social forum, so you are more likely to get a timely answer  there.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 8
(3,863 Views)

er last time i looked this is the labview discussion board. If you can use a csv file it is much easier. Either way look through the examples they can be very helpful and you can use them as is or tweak them to your needs

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 8
(3,833 Views)

CSV is not an option. I MUST work with EXISTING Excel files. I looked at ALL of the MS Office Toolkit vi's made for Excel and find NOTHING that allows me to write a column of data or a CELL of data to an existing Excel file. I can write a 2-dim array, or I can write TEXT, but no way to write, for example, trace data from a network analyzer. Seems like a significant omission, or else I'm missing something.

0 Kudos
Message 4 of 8
(3,821 Views)

@Akiel wrote:

er last time i looked this is the labview discussion board.


The post had initially been in the Breakpoint forum.

 

To OP: To open an existing workbook use the New Report VI and provide the name of the Excel workbook for the "template" input. You can then overwrite the file when you save the report by providing it the name of the existing workbook.

 

EDIT: Forgot the other half. To add your data, you can use the Excel Easy Table VI to place your data at a specific location.

0 Kudos
Message 5 of 8
(3,812 Views)

And there is no need to SHOUT.

 

Since you are a LabVIEW beginner, you need to understand some fundamentals about arrays. Just because the input is a 2D array, that does not mean you cannot insert a single row, column, or cell. You can convert a scalar or a 1D array into a 2D array with the Build Array function. Leave as is for a single row. Transpose for a single column.

0 Kudos
Message 6 of 8
(3,804 Views)

Dennis, I'm quite familiar with all the fundamentals of arrays. Yes I can manipulate my data as you suggest to prepare it to be used in the "Excel Specific" toolkit, which I maintain is a gross misnomer in that the tool isn't consistent with the most basic Excel operations, as we just discussed. I would expect if it's Excel Specific it would readily accept column and cell data w/o external modification, AND I would expect cell references to be Excel consistent, using rows numbered from 1 and columns with letters instead of the Labview standard array base 0 references. It also wasn't obvious that the input labeled "Template" is where one creates the filename and path for the Excel file name that is being opened for reading data. These details are sorely lacking in the help files.

0 Kudos
Message 7 of 8
(3,783 Views)

Personally, I think the help for the Template input is pretty clear.

 

 

 

As far as the row and column numbering, I can see your point as an Excel user. As primarily a programmer, I have never liked microsoft's decision to use letters as column headers, though.

0 Kudos
Message 8 of 8
(3,767 Views)