Error Message:
Unable to cast COM object of type 'Microsoft.Office.Interop.Word.ApplicationClass' to interface type ‘'Microsoft.Office.Interop.Word._Application’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{00020970-0000-0000-C000-000000000046}’ failed due to the following error: Library not registered. (Exception from HRESULT 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

This problem is caused by incorrect COM Interop settings in the Windows registry. This can be caused by installing a newer version of Microsoft Office, and then removing it and installing an older version instead.

You should check the version of registry key is 8.6 in:

64bit Office:

32bit Office:
HKEY_CLASSES_ROOT \Interface\[00020970-0000-0000-C000-000000000046]\TypeLib

And the then browse to the registry key HKEY_CLASSES_ROOT\ WOW6432Node \TypeLib\[the TypeLib ID you just found].

In this key, there should only be 1 subkey, and it should be the same as the Version value you found previously. If this key contains multiple subkeys, you should remove it from registry.To resolve this problem, you can also repair Microsoft Office 2013.

To do this, follow these steps:
  1. Click on your Start menu and open the Control Panel
  2. Click on Uninstall a Program (or Add/Remove programs in Windows XP)
  3. Locate the entry for Microsoft Office and click on it. After you click on it, you should see a button labeled Change appear either next to it, or at the top of the list (depending on what version of Windows you have). Click this Change button.
  4. Once Microsoft Office setup appears, choose the Repair option and click Next to have Microsoft Office repair itself. You may need to reboot your computer once this process is complete; Microsoft Office setup will tell you if you need to do this once it is done.