I am getting HRESULT: 0x800A03EC on Worksheet.range method. Number of rows are more than 70K. Office 2007.
Code:
Microsoft.Office.Interop.Excel.Range
Just FYI, got the error trying to apply row style....
wSheet.Rows(y).Style = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
I also faced the same issue, when I was developing a application which exports project contents into excel file.
I could not found the resolution in forums for my problem, then I check the maximum capacity of excel and found below link which says
"Worksheet size 1,048,576 rows by 16,384 columns" and this was the issue in my case, I was exporting more than that rows. Refer below link for details
http://answers.microsoft.com/en-us/office/forum/office_2013_release-excel/with-excel-2013how-many-rows-will-this-contain/271264fb-3ab8-4c5b-aa0d-7095c5ac6108
Regards Prashant Neve
We were receiving the same. The exception was
Stacktrace: at Microsoft.Office.Interop.Excel._Workbook.SaveAs(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object Text VisualLayout, Object Local)`
with an inner exception of
Exception from HRESULT: 0x800A03EC 2012-11-01 10:37:59`
We were able to resolve the problem with information from this post, which I quote here for convenience...
This isn't directly answering the question, but I was getting this error when opening an xlsx file. The problem was that I was using forward slashes in my file path. See also https://stackoverflow.com/a/24635904/5932003. It used to work in previous versions of Excel, but not with Version 1711 (Build 8730.2127).
I was able to diagnose the problem using IDispatch->Invoke(..., EXCEPINFO, ...). The EXCEPINFO object contained a useful description of what went wrong. I was in C++ land, but I suspect that C# code similar to this SO post will do the trick: Packaging IDispatch Invoke with Parameters in C# (with DISPPARAMS).
Simply, the excel file is corrupt. Best solution is change/repair the file.(make a copy of the existing file and rename it)