IBM Support

More Information on 'Library not registered ... TYPE_E_LIBNOTREGISTERED' errors, relating to Microsoft COM "Interop assemblies" (corruption in the Windows registry)

Troubleshooting


Problem

End user is experiencing errors when using Excel-related functionality with Controller.
  • All the errors mention 'Library not registered ... TYPE_E_LIBNOTREGISTERED'
  • See separate IBM Technote #532153 for more information on symptoms.
During the investigation, it is clear that the cause is that the cause is that the 'bad' client device (laptop/PC where Controller client is running) has some corrupt/invalid Microsoft Office Primary Interop assemblies.
=> Question - What are Microsoft Office Primary Interop Assemblies, and how can they be fixed (on the corrupt/bad PC)?

Symptom

Example:
image 6053
Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IIF '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

Cause

In general, the cause of 'Library not registered ... TYPE_E_LIBNOTREGISTERED' errors is that the client device (where the Controller client is running) has corrupt/invalid Microsoft Office Primary Interop Assemblies installed/registered.
  • Microsoft Office Primary Interop Assemblies are components that are registered (inside the Windows registry) as part of an MS Office installation
  • These third-party (Microsoft) interoperability assemblies are used by Controller to trigger Excel tasks.
More Information:
Microsoft Office Primary Interop Assemblies are installed as part of the MS Office installation (on the client device). They are controlled by registry entries. Specifically, the Excel registry key (which is used by Controller, and displayed in the error message) is located here:
  • HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}
For example (working/good Office 365 with Excel 16.0 64-bit) the relevant registry key is:
image 6054
[HKEY_CLASSES_ROOT\Interface\{000208D5-0000-0000-C000-000000000046}]
@="_Application"
[HKEY_CLASSES_ROOT\Interface\{000208D5-0000-0000-C000-000000000046}\ProxyStubClsid32]
@="{00020424-0000-0000-C000-000000000046}"
[HKEY_CLASSES_ROOT\Interface\{000208D5-0000-0000-C000-000000000046}\TypeLib]
@="{00020813-0000-0000-C000-000000000046}"
"Version"="1.9"
The most important part of the above is inside "TypeLib", for example:
image 6059
In this case, it points to {00020813-0000-0000-C000-000000000046}
  • In turn, you can find that TypeLib key here: HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}
For example (working/good Office 365 with Excel 16.0 64-bit) the relevant registry key looks like:
image 6060
[HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}]
[HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.9]
"PrimaryInteropAssemblyName"="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"
@="Microsoft Excel 16.0 Object Library"
[HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.9\0]
[HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.9\0\Win64]
@="C:\\Program Files\\Microsoft Office\\Root\\Office16\\EXCEL.EXE"
[HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.9\Flags]
@="0"
[HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.9\HelpDir]
@="C:\\Program Files\\Microsoft Office\\Root\\Office16\\"

Resolving The Problem

Contact third-party software supplier (Microsoft) for official guidance on their third-party (Microsoft Office) product.
However, the following unofficial guidance is supplied (on a best endeavour basis) to explain how Microsoft Office Primary Interop Assemblies corruption can be fixed (on a bad PC):
1. WARNING: The following steps make changes to the Windows registry. Therefore (as a precaution), create a backup (for example exact image) of the PC
  • In other words, ensure you take adequate precautions before making any changes. 
  • Ideally perform the following on a 'test' PC first (before making the changes on a user's PC)
2. Ensure you only have one version of MS Office installed (for example Office 365)
  • In other words, uninstall older version(s) of Office (such as Office 2013)
3. Perform a Microsoft Office 'Repair' on the version of Office you have installed on your PC (for example Office 365)
  • TIP: Full instructions are provided by Microsoft - see link below
  • However, to summarise (inside "Programs and Features") right-click on the relevant Microsoft Office item and choose 'Change':
image 6063
Then choose either of the following options:
  • Quick Repair
  • Online Repair
Then wait for the process to complete:
image 6061
~~~~~~~~~~~~~~~~~~~~
4. Reboot the PC, and then test
  • If the problem remains, then continue with the next steps.
~~~~~~~~~~~~~~~~~~~~
5. Launch REGEDIT
6. Browse to here: HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}
  • Export that key (as a backup) to a REG file
7. Make a note of the number (for example 00020813-0000-0000-C000-000000000046) mentioned in the subkey TypeLib
  • Then open that relevant registry key, for example: HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}
  • Export that key (as a backup) to a REG file
8. Perform steps 6 & 7 on a 'good' PC (where the problem does not occur)
9. Compare the exported registry keys from the 'bad' and 'good' PCs
  • In other words, use Notepad to open the REG files
  • Try to spot the difference
  • Fix the corruption by making the appropriate changes in the registry (on the 'bad' PC)
10. Test.

Document Location

Worldwide

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS9S6B","label":"IBM Cognos Controller"},"ARM Category":[{"code":"a8m0z000000bpIoAAI","label":"Excel"}],"ARM Case Number":"TS004126739","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Document Information

Modified date:
11 September 2020

UID

ibm16332207