Error -41106 When Creating an Excel Report with the New Report VI

Updated May 24, 2019

Reported In

Software

  • LabVIEW Report Generation Toolkit
  • LabVIEW
  • LabVIEW Database Connectivity Toolkit

Other

  • Microsoft Excel
  • Microsoft Word

Issue Details

When I use the LabVIEW Report Generation Toolkit to create an Excel report or Word document I get the following error:

Error -41106 occurred at an unidentified location

Possible reason(s):

Report Generation Toolkit: Microsoft Word or Excel did not open. Make sure Microsoft Word or Excel is installed.

Solution

It is possible an extra registry key is available causing ActiveX to call upon the incorrect registry. This can be fixed in 2 ways:

  • Uninstall and reinstall Microsoft Office. This is the safest route, but takes a longer time.
  • Manually edit the registry keys in Windows Registry Editor. This is faster, but could potentially damage your computer. Steps to do this are included below.

Note: Editing the Registry can damage your computer. Making a backup copy before modifying the registry is strongly encouraged. 

  1. Go to Start»Run and type regedit and select OK. This will open the registry for editing.
  2. Go to the Registry Menu and choose Export Registry File.
  3. Select All for the export range, and select a file name. This will create a backup copy of the registry.
  4. Once the registry editor is open, navigate to the following key for Microsoft Excel:
    • HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}
  5. This key contains the location of the type libraries for Excel. Under this key, check the following subkeys, shown below, to have the correct data associated with them.
    • The data for the 1.0 subkey should be Microsoft Excel 5.0 Object Library
    • The data for the 1.2 subkey should be Microsoft Excel 8.0 Object Library
    • The data for the 1.3 subkey should be Microsoft Excel 9.0 Object Library
    • The data for the 1.4 subkey should be Microsoft Excel 10.0 Object Library
    • The data for the 1.5 subkey should be Microsoft Excel 11.0 Object Library
    • The data for the 1.6 subkey should be Microsoft Excel 12.0 Object Library (MS Excel 2007)
    • The data for the 1.7 subkey should be Microsoft Excel 13.0 Object Library (MS Excel 2010)
    • The data for the 1.8 subkey should be Microsoft Excel 15.0 Object Library (MS Excel 2013)
    • The data for the 1.9 subkey should be Microsoft Excel 16.0 Object Library (MS Excel 2016)
  6. If there are any other registry keys that are not assigned to a Microsoft Excel Object Library then those keys should be deleted. 
    • For example, if there is a registry 1.7 and it is not pointed to a Microsoft Excel Object Library it needs to be deleted.

Additional Information

The LabVIEW Report Generation Toolkit is built on ActiveX calls to Microsoft Office ActiveX controls. Error -41106 is a custom error code that is thrown by Report Generation Toolkit VIs when the underlying ActiveX calls are not able to open a reference to the ActiveX object.

Most likely a beta version of Microsoft Office has been installed and a proper uninstall of this version of Microsoft Office was not done. Also, this error code can occur when a piece of Office software is installed that is newer than the version of Excel used. For example, having Visio 2013 installed on the same machine as Microsoft Office 2010. Both scenarios can cause an extra registry key to be available. The registry key is not pointed to a Microsoft Excel Object Library and the Report Generation Toolkit is trying to use this registry. 

WAS THIS ARTICLE HELPFUL?

Not Helpful