I am struggling a lot while trying to close the Excel sheet and any Excel object using the
System.Runtime.InteropServices.
Marshal.FinalReleaseComObject(obj)Even though I am using the below code, the EXCEL.EXE is still running in the back , so not able to open and modify the Excel sheet.
Please help me ............. Need your quick response.
private
{
{
System.Runtime.InteropServices.
obj =
}
{
obj =
}
{
{
System.Runtime.InteropServices.
System.Threading.
}
}
}
if (obj != null)Marshal.FinalReleaseComObject(obj);Thread.Sleep(5000);
Aurosish MohantyPosted Feb 22, 2011, 3:54 AM
In my case I am opening the same Excel again and again in a loop and everytime I am trying to edit the sheet.
Please suggest me if any other solution ./..
Jaganathan BantheswaranPosted Feb 22, 2011, 3:42 AM
Try this ! .
excelApp.Quit();
Marshal.ReleaseComObject (excelWB);
Marshal.ReleaseComObject (excelApp);
excelApp = null;
This worked for a project which I was working on.
Press CheckBox if you feel this is correct answer !