Excel (orphan process)

  • Thread starter Thread starter charles
  • Start date Start date
C

charles

has anyone been able to release Excel Object from process
stack.

// my sample cleanup code
oWB.Close(null,null,null);
oXL.Workbooks.Close();
oXL.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject
(oRng);
System.Runtime.InteropServices.Marshal.ReleaseComObject
(oXL);
System.Runtime.InteropServices.Marshal.ReleaseComObject
(oSheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject
(oWB);
oSheet=null;
oWB=null;
oXL = null;
GC.Collect(); // force final cleanup!
 
If you close the workbook, then close the xlapp myBook.Close myExcelApp.Quit

Set oExcel to nothing instead of null
and try the GC.Collect then
 
Back
Top