I am using a Windows based application which uses COM Interop Excel in which the excel exports fails. This works in the development environment. But it fails when promoted to other environment.
Also the problem is it is not reproducible in local environment.
We are using Microsoft.Interop.Excel for opening the excel and updating the data.
While trying to add the workbook using Workbooks.Add method we are getting the following
System.Runtime.InteropServices.COMException.Exception from HRESULT:0X800A03EC
at Microsoft.Office.Interop.Excel.Workbooks.Add(Object Template)
thisWorkbook = OpenTemplate(new System.IO.FileInfo("XLSTemplate\\Test.xlsx"));
public Workbook OpenTemplate(FileInfo xlsFile)
Workbook wb = null;
wb = Workbooks.Add(xlsFile.FullName);
template = xlsFile;
if (wb != null)
if (!DebugOut.IsDebug & wb.Worksheets.Count > 0)
catch (Exception ex)
throw new Exception("Error in OpenTemplate",ex);
Any help and solution would be much appreaciated.