Hi,
What are the possible causes of the xlApp.Workbooks.Open(<filename>) throwing a System.Runtime.InteropServices.COMException? I tried to check the stack trace and I can't find a cause other than the InnerException being a NullPointerException
Interop Error is: HRESULT: 0x800A03EC
Error Code: -2146827284
Basically after the Open statement, the next statements before the process is completed is as follows:
//other page setting details
xlWorkbook.Save();
xlWorkbook.SaveAs(strFileName.Replace(".xlsx", ".xlsb"), _Excel.XlFileFormat.xlExcel12);
File.Delete(strFileName);
The file that it is attempting to save can already exist or can be a new file.
This is based on the download source code (epplus-59920b4b5f9f.zip)
Comments: Changing my question. I checked the other classes which are calling the Open method and they are working properly. However, the generated excel file saved in EPPlus in the class as xlsx is corrupted. This was the reason why the open method call failed. However, I would like to know how to determine the cause of the excel file getting corrupted. is there a log that is generated for me to trace?
What are the possible causes of the xlApp.Workbooks.Open(<filename>) throwing a System.Runtime.InteropServices.COMException? I tried to check the stack trace and I can't find a cause other than the InnerException being a NullPointerException
Interop Error is: HRESULT: 0x800A03EC
Error Code: -2146827284
Basically after the Open statement, the next statements before the process is completed is as follows:
//other page setting details
xlWorkbook.Save();
xlWorkbook.SaveAs(strFileName.Replace(".xlsx", ".xlsb"), _Excel.XlFileFormat.xlExcel12);
File.Delete(strFileName);
The file that it is attempting to save can already exist or can be a new file.
This is based on the download source code (epplus-59920b4b5f9f.zip)
Comments: Changing my question. I checked the other classes which are calling the Open method and they are working properly. However, the generated excel file saved in EPPlus in the class as xlsx is corrupted. This was the reason why the open method call failed. However, I would like to know how to determine the cause of the excel file getting corrupted. is there a log that is generated for me to trace?