Some computers report errors and some computers are normal.
Environment: vs2010 winform program, office2007
C # An error is reported when you operate Excel. Error:
The COM Object of the "system. _ comobject" type cannot be forcibly converted to the interface type "Microsoft. Office. InterOP. Excel. Workbook ".
This operation fails because QueryInterface is called for the COM component of the API whose ID is {00020800000000-0000-c000-000000000046 }.
Failed due to the following error: An error occurred while loading the Type Library/DLL. (The exception is from hresult: 0x80029c4a (type_e_cantloadlibrary )).
{45541000-5750-5300-4b49-4e47534f4655 }=>{ 00020813-0000-0000-c000-0000000000000046}
Solution: I compared the registry of the "normal computer" and "wrong computer. After modifying the registry, you can run it successfully.
Run --> Regedit open the Registry Ctrl + F to find [{00020800000000-0000-c000-000000000046}]-> change the value to typelib
Default Value: {00020813-0000-0000-c000-000000000046}
Version: 1.6