Workaround for exporting Excel "exception from HRESULT:0X800A03EC" Error (verified)

Source: Internet
Author: User

Workaround for exporting Excel "exception from HRESULT:0X800A03EC" error (verified)

It's hard to find an error that resolves the export data to Excel where "exception from Hresult:0x800a03ec" occurs.

Searching for solutions from Google, the online solution basically says that the starting line's subscript value is written in the 0 resulting "Excel." Cells[0, 1] = "1th row 1th column"; ", instead of more than 0 can be resolved, and so these are not effective. Insert Breakpoint, debug program, and "Cannot step into" error. Later, I looked at the anomaly carefully and found that the exception was from

"Excel. ActiveWorkbook.SaveAs (FilePath + filename, Excel.XlFileFormat.xlExcel9795, NULL, NULL, FALSE, FALSE, Excel.XlSaveAsAccessMode.xlNoChange, NULL, NULL, NULL, NULL, or NULL); This statement jumps out, and if I start writing the small label of the data row from 0, the exception will jump out of the line when it is written. The problem may be found in the argument of this statement, so the statement was arbitrarily changed to "Excel." ActiveWorkbook.SaveAs (FilePath + filename, Excel.XlFileFormat.xlExcel7, NULL, NULL, FALSE, FALSE, Excel.XlSaveAsAccessMode.xlNoChange, NULL, NULL, NULL, NULL, or NULL); Found to solve the problem.
This is probably the wrong version of my Excel (my Excel version is 2007), but using the 2003 library, actually changed the EXCEL.XLFILEFORMAT.XLEXCEL7 to " xlWorkbookNormal"best.

Note: FilePath + filename: I'm using Filename.xls, and using filename.xlsx will cause problems.

Workaround for exporting Excel "exception from HRESULT:0X800A03EC" Error (verified)

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.