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: 

How to write a new row in an existing excel file each time I run the VI?

Hi everyone,

is there any one tel me how I can store my data input in a new row of excel file each time i run the VI, in other words while iam running the VI there is a new data will be keyed in as a parameter and i need to save these parameters in a new raws of the same file.

 

thanks for any advice

0 Kudos
Message 1 of 4
(2,706 Views)

Hi Aneece,

where do you have problems? Are you aware of Excel with ActiveX?

You can open your excel file each time you run your vi. You can then read how many rows are in there and write your new data in the row after the last used.

 

Mike

0 Kudos
Message 2 of 4
(2,696 Views)

Hi Aneece,

 

in case you speak of csv/tsv files as "Excel files" you should simply switch the "attach?" input of text write functions to TRUE...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(2,693 Views)

I think Gerd means the "append to file?" input of the Write to Spreadsheet File VI if you use that to create text files that Excel can import.

 

If you absolutely, unequivocally, have to use ActiveX to write to an Excel file then you can use this bit of code to get the last used row:

Note that this assumes there's a value in each cell in the first column.

Message Edited by smercurio_fc on 06-21-2009 10:02 AM
Message 4 of 4
(2,678 Views)