In. net, when Excel library 11.0 com workbooks. Open is used, the following error occurs: system. missingmethodexception: The method cannot be found.

Source: Internet
Author: User
There was a strange problem these two days.
When using. Net to call the booksopen method of Excel, an error occurs:
Method not found: excel. workbook excel. workbooks. open (system. string, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object ).

Note:An error occurred while executing the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details:System. missingmethodexception: method not found: excel. workbook excel. workbooks. open (system. string, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object, system. object ).

I searched the internet and found this error, mostly because the exce referenced during compilation is different from the Excel version in the running environment.
However, if I compile locally and run locally, this problem should not occur.

My web program references an internal library, the internal library references Excel, and calls the books open method of Excel.
Structure:

I tested on three machines. On the two machines, I reported that the open method could not be found, and one was normal.

Later, I found a solution: Reference Excel com again in the Web application project, and the test will be normal.

However, I still don't know the exact cause of this situation.


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.