LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel.EXE remains in memory

Hello All,

We are generating excel sheets using COM Interop. When the sheet
generation is successful, it removes the EXCEL.EXE from the task
manager. However, if we have any error in the application, the
EXCEL.EXE remains in memory (can see it in task manager). What are we
doing wrong? Any inupt will be highly appreciated.

Here's the cleanup code:

finally
{
if (module != null)
Marshal.ReleaseComObject(module);
if (range != null)
Marshal.ReleaseComObject(range);
if (color != null)
Marshal.ReleaseComObject(color);
if (sheet1 != null)
Marshal.ReleaseComObject(sheet1);
if (sheet2 != null)
Marshal.ReleaseComObject(sheet2);
if (sheet3 != null)
Marshal.ReleaseComObject(sheet3);
if (workbook != null)
Marshal.ReleaseComObject
(workbook);
if (excelApp != null)
Marshal.ReleaseComObject(excelApp);

module = null;
range = null;
color = null;
sheet1 = null;
sheet2 = null;
sheet3 = null;
workbook = null;
excelApp = null;
}


Thanks,
Harshu

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Addin remains in memory! Rob Excel Programming 2 January 3rd 05 07:56 PM
VB Code Remains In Memory Paul Moles Excel Programming 9 December 13th 04 02:13 PM
Visual Basic Code Remains in "memory" Paul Moles Excel Worksheet Functions 1 December 10th 04 10:29 PM
Closed workbook remains in memory. Kent Prokopy[_3_] Excel Programming 6 December 4th 03 01:37 PM
Excel process remains running Josh[_5_] Excel Programming 2 September 11th 03 04:22 PM


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"