LabVIEW Save Excel File in Different Sheet Using ActiveX Node

Updated Nov 30, 2022

Reported In

Software

  • LabVIEW

Other

  • Microsoft® Excel 64-bit

Issue Details

I am running the LabVIEW shipping example Excel - Write Table.vi. Every time after I run the VI, I notice that Sheet1 in the Excel file is blank and the results are saved in Sheet2. Any method to save the results in Sheet1 instead of Sheet2?

Solution

Referring to the shipping example Excel -Write Table.vi, the Sheets invoke node is using Add method as below.
Excel- Add sheets.png
The Add method will add a new sheet in the Excel file, thus the results will be saved in Sheet2 instead of Sheet1.

In order to save the results in Excel Sheet1, you can change the Sheets invoke node to use Item method and wire the Index to Sheet1.
Excel- item.png
 

Additional Information

If there are no properties or methods to be selected when you right-click on the Property Node or Invoke Node, this might be because you are using different bitness Microsoft Office and LabVIEW. For more information regarding this issue, please check on this KB: Cannot Access Methods or Properties for Microsoft Office ActiveX Reference.