To solve the problem of C # calling excel interface error, prompt: the COM object of Microsoft. Office. Interop. Excel. Applicationclass is forcibly converted to the interface type “Microsoft. Offi”

Solve the problem of C # calling excel interface error, prompt: the COM object of microsoft.office.interop.excel.applicationclass is forcibly converted to the interface type of microsoft.office.interop.excel_ Application”。 This operation failed because the IID is “{000208d5-0000-0000-c000-000000000046}”

For more information about calling just in time (JIT) debugging instead of this dialog,
see the end of this message.

**************Exception text ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^_ Application”。 This operation failed because the queryinterface call to the COM component of the interface with IID “{000208d5-0000-0000-c000-000000000046}” failed with the following error: the library is not registered( Exception from HResult: 0x8002801d (type_ E_ LIBNOTREGISTERED))。

1. Run the “regedit” command to open the registry
2. In the registry address bar, enter:
Computer/HKEY_ CLASSES_ Root/typelib {00020813-0000-0000-c000-000000000046}
locate to the {00020813-0000-0000-c000-000000000046} folder
3. Delete the 1.9 folder under {00020813-0000-0000-c000-000000000046} (the author’s computer is office 2013, 1.8 and 1.9 folder coexist at the same time, delete the higher version)
4. Start the program again, OK

Read More: