Error -41113 at Excel Import Module VI in LabVIEW Report Generation Toolkit

Updated Dec 22, 2023

Reported In

Software

  • LabVIEW
  • LabVIEW Report Generation Toolkit

Other

  • Microsoft Word
  • Microsoft Excel

Issue Details

I am using the Report Generation Toolkit to create Microsoft Office reports. Everything seems to work until I try to import a Macro using the Excel Import Module VI and I receive:

Error -41113 occurred at NI_Excel.lvclass:Excel Import Module.vi ->

Possible reason(s):

Report Generation Toolkit: You have not selected Visual Basic Project as a Trusted Source in Microsoft Word or Excel. Check the Macro Security settings in Word or Excel.


Error -41113.png

Why am I getting this error?

Solution

This error can occur at either the Excel Import Module.vi or Word Import Module.vi. The directions below are assuming you receive the error with Excel. If you are using Word simply replace the text Excel with Word below.

To get rid of this error you must follow the advice from the error message and make Visual Basic a trusted macro source.
 

  • In Microsoft Excel 2003 go to Tools»Options»Security»Macro Security»Trusted Publishers and click the checkbox next to both Trust all installed add-ins and templates and Trust access to Visual Basic Project.
 
  • In Microsoft Excel 2007, click the Office Button in the top left then click Excel Options. Click on Trust Center from the list on the left, and then click Trust Center Settings... Click on Macro Settings and check the box for Trust access to the VBA project object model.
 
  • In Microsoft Excel 2010 and newer, click the File Tab in the top left then click Options. Click on Trust Center from the list on the left, and then click Trust Center Settings... Click on Macro Settings and check the box for Trust access to the VBA project object model.


It may be necessary to restart the computer after making this change for it to take effect in LabVIEW.

If you encounter this error when deploying an application built in LabVIEW containing the Excel Import Module.vi or Word Import Module.vi, make sure to make Visual Basic a trusted macro source in the deployment machines as well.