HRESULT: 0x800A03EC on Worksheet.range
Solution 1:
This problem occurs if you are using a backwards compatible sheet (a .xls) instead of a .xlsx
To allow sheets to be opened in pre office 2007 version it can't contain more than 65k rows. You can check the number of rows in your sheet by using ctrl+arrowdown till you hit the bottom. If you try to get a range larger than that number of rows it will create an error
Solution 2:
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...
- Login to the server as a administrator.
- Go to "Start" -> "Run" and enter "taskmgr"
- Go to the process tab in task manager and check "Show Processes from all users"
- If there are any "Excel.exe" entries on the list, right click on the entry and select "End Process"
- Close task manager.
- Go to "Start" -> "Run" and enter "services.msc"
- Stop the service automating Excel if it is running.
- Go to "Start" -> "Run" and enter "dcomcnfg"
- This will bring up the component services window, expand out "Console Root" -> "Computers" -> "DCOM Config"
- Find "Microsoft Excel Application" in the list of components.
- Right click on the entry and select "Properties"
- Go to the "Identity" tab on the properties dialog.
- Select "The interactive user."
- Click the "OK" button.
- Switch to the services console
- Start the service automating Excel
- Test you application again.