Why Do My ActiveX Calls in LabVIEW Generates Error -2147352565 with Microsoft Excel

Updated Jul 11, 2023

Reported In

Software

  • LabVIEW
  • LabVIEW Report Generation Toolkit

Issue Details

When programming Microsoft Excel with ActiveX in LabVIEW, the Sheets invoke node returns error -2147352565.
Why does this happen? 

Solution

Using the Sheets invoke node with an incorrect value for the Index input will cause this error. The default should be Sheet1 but if your workbook doesn't have a worksheet named Sheet1 you will get this error. Open the Excel file you are trying to open with Microsoft Excel and find out the correct worksheet name is for that workbook. Use this name as the input for Index on the Sheets invoke node. 

Additional Information

Note: Microsoft Word and Microsoft Excel are powerful standard software packages for creating reports. Because of their popularity, some LabVIEW users programmed LabVIEW ActiveX applications to dynamically control these document packages for generating reports from LabVIEW. The complexity of the ActiveX interface of those packages, however, makes the development of custom applications difficult. With the LabVIEW Report Generation Toolkit, which is included with LabVIEW Professional 2014 and later, you are no longer have to learn the complex object models of Microsoft Word and Excel to generate a report. The Report Generation Toolkit is a library of flexible, easy-to-use VIs for programmatically creating and editing Microsoft Word and Excel reports from LabVIEW.