This operation fails because QueryInterface is called for the COM component of the API whose ID is {00020800000000-0000-c000-000000000046 }.

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.