Excel (orphan process)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • charles

    #1

    Excel (orphan process)

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

    // my sample cleanup code
    oWB.Close(null, null,null);
    oXL.Workbooks.C lose();
    oXL.Quit();
    System.Runtime. InteropServices .Marshal.Releas eComObject
    (oRng);
    System.Runtime. InteropServices .Marshal.Releas eComObject
    (oXL);
    System.Runtime. InteropServices .Marshal.Releas eComObject
    (oSheet);
    System.Runtime. InteropServices .Marshal.Releas eComObject
    (oWB);
    oSheet=null;
    oWB=null;
    oXL = null;
    GC.Collect(); // force final cleanup!
  • William Ryan

    #2
    Re: Excel (orphan process)

    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
    "charles" <charlessjohnso n@hotmail.com> wrote in message
    news:07a501c381 57$9acdeaf0$a40 1280a@phx.gbl.. .[color=blue]
    > has anyone been able to release Excel Object from process
    > stack.
    >
    > // my sample cleanup code
    > oWB.Close(null, null,null);
    > oXL.Workbooks.C lose();
    > oXL.Quit();
    > System.Runtime. InteropServices .Marshal.Releas eComObject
    > (oRng);
    > System.Runtime. InteropServices .Marshal.Releas eComObject
    > (oXL);
    > System.Runtime. InteropServices .Marshal.Releas eComObject
    > (oSheet);
    > System.Runtime. InteropServices .Marshal.Releas eComObject
    > (oWB);
    > oSheet=null;
    > oWB=null;
    > oXL = null;
    > GC.Collect(); // force final cleanup![/color]


    Comment

    Working...