Error -2147352565 When Doing Microsoft Excel ActiveX Calls in LabVIEW

Updated Oct 21, 2024

Reported In

Software

  • LabVIEW
  • LabVIEW Report Generation Toolkit

Issue Details

  • When programming Microsoft Excel with ActiveX in LabVIEW, the Sheets invoke node returns the following error, why does this happen?

Error -2147352565 occurred at invalid index in Untitled.vi

This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error input. 

Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2147352565) or for its hexadecimal representation (0x8002000B)



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.