Error -41106 Using LabVIEW Report Generation Toolkit

Updated Jul 31, 2023

Reported In

Software

  • LabVIEW Report Generation Toolkit
  • LabVIEW

Other

  • Microsoft Excel
  • Microsoft Word
  • NI LabVIEW

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.

  • I get error -41106 when trying to open a Microsoft Word document with the Report Generation Toolkit. However, Microsoft Excel works fine. How can I fix it?

Solution

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

The recommended methods to address this are:

Alternatively, the registry keys can be manually edited in Windows Registry Editor. This is a faster option but can cause damage to your PC if done incorrectly.

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

To manually edit the registry keys, follow the steps below:

  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.
  7. Navigate to the following key for Microsoft Word:
    • HKEY_CLASSES_ROOT\TypeLib\{00020905-0000-0000-C000-000000000046}
  8. This key contains the location of the type libraries for Word. Under this key, check the following subkeys, shown below, to have the correct data associated with them.
    • 8.3 - Microsoft Word 11.0 Object Library (Office 2003)
    • 8.4 - Microsoft Word 12.0 Object Library (Office 2007)
    • 8.5 - Microsoft Word 14.0 Object Library (Office 2010)
    • 8.6 - Microsoft Word 15.0 Object Library (Office 2013)
    • 8.7 - Microsoft Word 16.0 Object Library (Office 2016)
  9. If there are any other registry keys that are not assigned to a Microsoft Word Object Library then those keys should be deleted. 
Note: if reinstalling Microsoft Office and modifying the registry keys does not resolve the issue, reimaging the PC is another known solution.

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.

It's likely that a Beta version of Microsoft Office has been installed and a proper uninstall of this version of Microsoft Office was not done. This error code can also 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.