Just trying to sort an early binding issue with MSWord, created from a Winform.
Code works as expected on Client machine but not on dev machine.
It works fine if late binding
Error:
Steps
-Googled
-Appears to be registry problem with various previous Office installs
-Tried recommended reg fixes, same issue
- Removed Office, ran Microsoft repair tool to remove ALL traces of Office
- Reinstalled Office365
- Same issue exists.
- Removed analyzer for Microsoft.Office.Interop.Word
- Added current version (although it showed it was the same version)
- Rebuilt and ran code, same error
- Checked registry once more, IID 00020970 does not exist, actual IID 00020905
Actual path: Computer\HKEY_CLASSES_ROOT\TypeLib\{00020905-0000-0000-C000-000000000046}\8.7
If I am correct, the issue appears to be analyzer pointing to wrong registry entry or an old reference still being used in code?
Any suggestions as to what would change the COM component call to the right entry?
Error images:
![Name: Untitled1.jpg
Views: 55
Size: 42.3 KB]()
![Name: Untitled2.jpg
Views: 53
Size: 10.9 KB]()
![Name: Untitled3.png
Views: 54
Size: 19.1 KB]()
Code works as expected on Client machine but not on dev machine.
It works fine if late binding
Error:
Code:
An unhandled exception of type 'System.InvalidCastException' occurred in PTApplication.exe
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: Interface not registered (Of Exception from HRESULT: 0x80040155).
-Googled
-Appears to be registry problem with various previous Office installs
-Tried recommended reg fixes, same issue
- Removed Office, ran Microsoft repair tool to remove ALL traces of Office
- Reinstalled Office365
- Same issue exists.
- Removed analyzer for Microsoft.Office.Interop.Word
- Added current version (although it showed it was the same version)
- Rebuilt and ran code, same error
- Checked registry once more, IID 00020970 does not exist, actual IID 00020905
Actual path: Computer\HKEY_CLASSES_ROOT\TypeLib\{00020905-0000-0000-C000-000000000046}\8.7
If I am correct, the issue appears to be analyzer pointing to wrong registry entry or an old reference still being used in code?
Any suggestions as to what would change the COM component call to the right entry?
Error images: