LabVIEW Crash in Executable at Save Report to File VI

Updated Aug 1, 2023

Reported In

Software

  • LabVIEW Report Generation Toolkit
  • LabVIEW

Other

  • Microsoft Office

Issue Details

I built an executable that uses the Save Report to File VI from the LabVIEW Report Generation Toolkit. When I ran the executable on a different computer, it crashed when the application tries to open Excel. How can I correct this behavior?

Solution

A reason for the crash can be a change to the ActiveX API, which added an additional paramater.

Sometime around late 2016, Microsoft updated their ActiveX API, and these changes were automatically pushed to users of Microsoft Office 365 in Version 1609. An extra parameter called WorkIdentity was added to the ActiveX function call SaveAs, which is an Excel Workbook method. If you have the WorkIdentity parameter on your version of Excel, an executable you build with Save Report to File will not be backwards compatible with older versions of Excel, which do not have the parameter.

Excel Update Status Observed Excel VersionWorkIdentity Parameter?
Not UpdatedEarlier Than 1609No
Updated1609 or LaterYes
  1. Open any Office application and go to File » Account.
  2. Check the version and build of Office on the right side of the screen, under the category Office Updates.
  • Executables built on computers with Version 1609 or newer will only run on computers with Version 1609 or newer.
  • Executables built on computers with older versions of Excel will still be able to run on computers with Version 1609 or newer.
As a general rule, it is recommended to use the same software version on development and target computers when deploying executables.

If this is not possible to ensure, that all targets are running an updated version of Excel, a workaround can be to build the SaveAs Invoke Node into a PPL on a computer with an old Excel version installed. In the PPL, the SaveAs Invoke Node will continue to work also on machines with newer Excel, despite not containing the WorkIdentity parameter.

Additional Information

There can be other reasons for a crash:

  • Check the compatibility between the used version of the Report Generation Toolkit and the installed Office suite. You can find details on the compatibility here: ​Report Generation Toolkit Compatibility with Microsoft Office and LabVIEW.
  • A crash can also appear when executing the application under a runtime that does not meet the bitness of the development system with which the executable was created. Please make sure that you run the executable with a runtime environment in the same bitness as the executable was built (32-bit executable in 32-bit LabVIEW-Run-Time, 64-bit executable in 64-bit LabVIEW-Run-Time).