Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Unable to release Excel COM object

Hi,

I have to code a ASP.Net application, where the user will be able to open an
excel file on clicking a web button. I have implemented the application using
Excel PIA of Office 2k3. I have completed the code, but
the Excel.exe process is still visible in the Task Manager.

The code i use to close Excel object is given below.
// m_Excel is Excel.Application object
if(m_Excel != null)
{
m_Excel.Quit();
m_Excel = null;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
}

The code compiles and executes properly. But after I close the application,
I can still view the Excel.exe process in the Task Manager. The process
remains in the background untill I close it manually.

I also tried using ReleaseCOMObject but was unsuccessful.

I tried the methods in the following URL, but nothing worked.
http://msdn.microsoft.com/office/pro...ych2_part2_rco

Does anyone know the solution to the problem.
Can anyone tell me the way to
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Unable to release Excel COM object

You have to be sure you release all object variables, not only the "m_Excel"
application.
Also, make sure all your variables are fully qualified.
Use
m_Excel.Workbooks("Whatever.xls").Worksheets("Whic hOne").Range("A1")

NickHK

"Avadhoot" ...
Hi,

I have to code a ASP.Net application, where the user will be able to open
an
excel file on clicking a web button. I have implemented the application
using
Excel PIA of Office 2k3. I have completed the code, but
the Excel.exe process is still visible in the Task Manager.

The code i use to close Excel object is given below.
// m_Excel is Excel.Application object
if(m_Excel != null)
{
m_Excel.Quit();
m_Excel = null;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
}

The code compiles and executes properly. But after I close the
application,
I can still view the Excel.exe process in the Task Manager. The process
remains in the background untill I close it manually.

I also tried using ReleaseCOMObject but was unsuccessful.

I tried the methods in the following URL, but nothing worked.
http://msdn.microsoft.com/office/pro...ych2_part2_rco

Does anyone know the solution to the problem.
Can anyone tell me the way to



Reply
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
Unable to cast com object (interop) yh Excel Discussion (Misc queries) 0 April 26th 10 09:16 AM
-2147352573 (80020003): Unable to find the specied object Omar Excel Programming 0 August 24th 05 08:16 PM
PivotTable Object - Unable to get the name property Alan Excel Programming 0 December 6th 04 10:29 PM
Function unable to return Collection object Adrian[_7_] Excel Programming 1 July 12th 04 06:22 PM
unable to create embedded object on a userform Robert Nobles Excel Programming 0 September 9th 03 08:49 PM


All times are GMT +1. The time now is 05:41 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"