This is my system environment
- Windows 10 64bit
- Office 2013 32bit
- Visual Studio 2019, Build Only x86
- I have no choice but to use 32bit excel.
- I develop with C# and I already reference assembly
- I also checked reference properties : Local copy(true), Include interop type(true)
- Object Framework is .NET 5.0
- Output : Console application
The error comes up this below code
Microsoft.Office.Interop.Word.Application winWord = new Microsoft.Office.Interop.Word.Application();
And Error message like below.
System.InvalidCastException: 'Unable to cast COM object of type 'System.__ComObject' 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)
What is important :
- I already tried restore, uninstall MicroSoft Office 3 times.
Also I search it on Google almost 7 days I tried like this site Error accessing COM components
But Always faild to solve the error.
Now I'm gonna crazy. Please give me any help