2 Excel exceptions

Source: Internet
Author: User

Two exceptions occurred during Excel export today:

"Hresult: 0x800a03ec"

There are many causes for this exception. The problem I encountered was that a naming error in the table area resulted in Microsoft. office. interOP. excel. range namerange = oworksheet. get_range (cellname, type. the name cannot be found, and an error occurs. Name of the region corresponding to the Change number

 

"The select method of the range class is invalid"

The cause of this exception is that the range cannot be directly obtained by get_range. select (); first, make sure that the sheet in which the range is located is the current working sheet. Therefore, run sheet first. select () for example:

Microsoft. Office. InterOP. Excel. Range namerange = oworksheet. get_range (cellname, type. Missing );

Oworksheet. Select (type. Missing );

Namerange. Select ();

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.