Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have tryed all the various versions of closing an excel object, but it
still remains in the Task Manager. CODE SAMPLE ONE: ===================================== xlBook.SaveAs(getFile, Excel.XlFileFormat.xlWorkbookNormal, null, null, true, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null); xlBook.Close(null, null, null); xlApp.Workbooks.Close(); xlApp.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlApp); System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlSheet); System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlBook); xlSheet = null; xlBook = null; xlApp = null; GC.Collect(); // force final cleanup! CODE SAMPLE TWO: ===================================== xlBook.Close(true, GLName, null); xlApp.Workbooks.Close(); GC.Collect(); // force final cleanup! GC.WaitForPendingFinalizers(); System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlRng); xlRng = null; System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlSheet); xlSheet = null; System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlBook); xlBook = null; xlApp.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlApp); xlApp = null; ================================================== I really hoped that this was fixed by now, I 've been fighting with this since VB6... Any suggestion? -- MJB |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
why do all excel worksheets/workbooks close when I close one? | Excel Discussion (Misc queries) | |||
Can I stop the close method in an auto close macro | Excel Programming | |||
Not close thead when I close excel | Excel Programming | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel |