I have a real pain of an issue whereas the Excel.Application()
does not want to get released, no matter what. Even after a new class is instantiated and disposed immediately afterwards, it still appears in the process list.
if (_ExcelApp == null)
_ExcelApp = new Microsoft.Office.Interop.Excel.Application();
Dispose();
public void Dispose()
{
if (_ExcelApp != null)
{
try
{
_ExcelApp.Quit();
Marshal.FinalReleaseComObject(_ExcelApp);
}
catch (Exception) { }
_ExcelApp = null;
}
}
Please help!
_ExcelApp
and dispose of it immediately. However, If I do_ExcelApp.Workbooks.Add()
(note no parameter) and then try to expose of_ExcelApp
, it keeps holding on to the application.