Some users with Microsoft Office 2013 began to complain about bug that happened during document exporting to Excel. Stack trace begins with line:
Microsoft.Office.Interop.Excel.ApplicationClass.Save(Object Filename) error Exception from HRESULT: 0x800A03EC. With ErrorCode: -2146827284. And nothing else. This error code, according to different articles in internet, can arise due to many reasons. Below is my version that can help somebody.
Code that leads to this error was:
Application xapp = null;
Workbook workbook = null;
xapp = new Application
DisplayAlerts = false,
Visible = false
workbook = xapp.Workbooks.Open(fileName);
// Do some exporting things
xapp.Save(); // this line produces error!
After some investigantions and tries I’ve found that line
should be replaced with line:
and this helped to fix bug.