From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to excel spreadsheet in columns and append to file in a new column

I have a loop in which for each iteration, an array gets written to a spreadsheet file.  I know I can transpose the input data and have it show up in a column in the spreadsheet file.  However, on the next iteration, I want the new array to get appended to the spreadsheet file in a new column, instead of in the same column after the previous array.  Any ideas?
0 Kudos
Message 1 of 5
(6,654 Views)

Are you actually writing to an Excel Spreadsheet?  Or are you using the Write to Spreadsheet file function which does not write to an Excel spreadsheet, but creates a text file that Excel is able to open?

 

I'm going to assume the latter.  There is no way to just "append" a column to it.  You will need to read the whole file, append the column to the array, and write out the whole file column overwriting the previous file.

0 Kudos
Message 2 of 5
(6,645 Views)

If you write directly in Excel you could utilize "write_to_active_cell.llb" (http://zone.ni.com/devzone/cda/epd/p/id/4523) with small modifications.

 

Jean-Marc

0 Kudos
Message 3 of 5
(6,638 Views)

Hi,

 

Assume you have report generation toolkit installed for MS office,

 

You read the array data and want to append the data to excel file, each time you read the array data increment the column number by one, If you report generation toolkit for MS office you will get excel VI's asking for the which row which column.

 

You can alter column value everytime to update new data into excel file.

0 Kudos
Message 4 of 5
(6,605 Views)
Thank you all.  I'll try out a couple of those ideas.
0 Kudos
Message 5 of 5
(6,586 Views)