Write Data to an Excel File Using the LabVIEW Report Generation Toolkit

Updated Apr 11, 2023

Environment

Software

  • LabVIEW
  • LabVIEW Report Generation Toolkit

I want to write data to an Excel worksheet using the Easy Table VI of the LabVIEW Report Generation Toolkit for Microsoft Office. How do I do it?

To write data to an Excel worksheet using the LabVIEW Report Generation Toolkit for Microsoft Office, use the following steps:

  1. Create a new report. Right-click your block diagram and select Report Generation>>New Report.vi and then drop the VI on the block diagram.
  2. Wire the inputs report type and template with a constant set to Excel and the file path of the Excel worksheet respectively.
  3. Select the worksheet of interest. Right-click your block diagram and select Report Generation>>Excel Specific>>Excel General>>Excel Get Worksheet.vi and then drop the VI on the block diagram.
  4. Wire the outputs report out and error out of the New Report.vi to the respective inputs of Excel Get Worksheet.vi
  5. Wire the input worksheet index of the Excel Get Worksheet.vi to a constant with the index number of the worksheet you want to write the data. The name of the worksheet of interest can also be wired to select the worksheet of interest. It can be wired in the name("") input.
  6. Add the data to the worksheet. Right-click your block diagram and select Report Generation>>Excel Specific>>Excel Easy Table.vi and then drop the VI on the block diagram.
  7. Wire the outputs report out and error out of the Excel Get Worksheet.vi to the respective inputs of Excel Easy Table.vi
  8. To add data to the worksheet wire an array of data to the data input of the Excel Easy Table.vi. The data type will change depending on the data type wired in. Additional parameters can be changed like the font, the headers and the position where the table will appear.
  9. Close the report. Right-click your block diagram and select Report Generation>>Dispose Report.vi and then drop the vi on the block diagram. Wire the outputs report out and error out of the Excel Easy Table.vi to the respective inputs of Dispose Report.vi
  10. To save the changes, wire a boolean constant to the input save changes? and set it to TRUE.