Inserting Data to Existing Excel File Using LabVIEW Report Generation Toolkit

Updated Apr 23, 2026

Environment

Software

  • LabVIEW Report Generation Toolkit

Programming Language

  • LabVIEW G

The following guide explains the process of writing or inserting data into an existing Excel (.xlsx) file using the Report Generation VIs in LabVIEW. It will detail the following options:

  • Inserting data at the beginning or in the middle of an Excel file
  • Appending data to the end of an Excel file
  • Replacing the contents of a cell in an Excel file
     

To insert to the beginning or middle of an Excel file:

  1. Configure LabVIEW to open an existing Excel file by using the Create Report VI with Excel as the report type and the file path of your Excel file as the template. This will open your existing Excel file and any subsequent Report VIs will modify the existing file.
  2. To insert data at the beginning or middle of your file you need to first add new space in which to place the data. Use the Excel Insert Cells VI to add new cells, rows, or columns to your Excel file depending upon the amount of data you will add. Select where the new cells will be placed and then use other Report VIs to insert your data into this space.
  3. Use the same start values used for the Excel Insert Cells VI for the start position input terminal of the VI you will use to insert the data. For example, if you used the Excel Easy Table VI, you would wire your desired start values to the Start (0,0) terminal. In this example a 2D string array is being written as data via the Excel Easy Table VI.

 Example adding data at the top left of the sheet (change the start (0,0) coordinate if you want to add to the middle of the file):

 

 

 

To append to the End of an Excel file:

  1. Configure LabVIEW to open an existing Excel file by using the Create Report VI with Excel as the report type and the file path of your Excel file as the template. This will open your existing Excel file and any subsequent Report VIs will modify the existing file.
  2. You can programmatically append data to your existing Excel file by first using the Excel Get Last Row VI to get the position of the last row and column in the Excel file. This VI will return a cluster that includes the position of the last row and column.
  3. Use an Unbundle By Name function to extract the Position of the last row and column from this cluster.
  4. Use this Position as the input start position for the VI you will use to insert the data.  For example, if you used the Excel Easy Table VI you would wire this Position to the Start (0,0) terminal.

Example adding data at the start of last row:

 

Note: To write to an Excel file each iteration of a loop, see this community example.

 

To replace the contents of a cell in an Excel file:

  1. Configure LabVIEW to open an existing Excel file by using the Create Report VI with Excel as the report type and the file path of your Excel file as the template. This will open your existing Excel file and any subsequent Report VIs will modify the existing file.
  2. To replace the contents of a cell, use the Excel Easy Text VI to specify the destination cell and its new value. Note that rows and columns in Excel are zero-indexed.

 Example replacing the value of the cell in the second row (index 1) and first column (index 0):

Additional Information

You can specify the Excel sheet that you want to write using the Excel Get Worksheet VI.
Capture.PNG

The following image illustrates the result when inserting data at the beginning or the end of the Excel file using the techniques described above.