Hi All,
we are working on windows application(Windows XP Professional Version 2002 Service Pack 3, Dot net framework 2.0, C#, Microsoft office 2003/2007). We are generating
excel report using Microsoft Office Excel component[Microsoft Excel 11.0 Object Library for Office 2003 and Microsoft Excel 12.0 Object Library for Office 2007].
Consider we generate a Excel report using our C# application and save it on desktop (say Report1.xls) and again go for generating another excel report using
the same application. When this process is still running, simultaneously open already saved report (Report1.xls ) and try to edit it. On editing the report we are getting the following COM exception.
“System.Runtime.InteropServices.COMException (0x800AC472): Exception from HRESULT: 0x800AC472”.
After completion of generating excel report, still the excel.exe process running in the task manager.
We have tried following solution to resolve the issue:
Ø To
release the object we have used
ExcelApplication.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject (ExcelSheet); System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelBook);
System.Runtime.InteropServices. Marshal.ReleaseComObject(ExcelApplication);
ExcelSheet = null;
ExcelBook = null;
ExcelApplication = null;
System.GC.Collect();
Please help us resolve the COMException.
Thanks in advance..