Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.excel.programming,microsoft.public.officedev
external usenet poster
 
Posts: 2
Default .NET application does not release Excel

Let me prefix with, I've done many VB6 and ASP applications that read
from/write to Excel and have never had a problem. I'm not a beginner at
this...

I have created my first .NET Windows application that reads from Excel 2000
and writes to a tab file. I am using the code below and when stepping
through the appExcel.Quit() is executed. However, the EXCEL.EXE process
still runs and will run until I close the .NET application I've built. This
happens in both DEBUG and RELEASE compilations.

Try
appExcel = New Excel.Application()
... coding tasks ...

Catch ex As Exception
... error tasks ...

Finally
appExcel.Quit()

Any ideas why Excel is not being released after the quit? I even tried
adding GC.Collect() to see if it helps to force the Garbage Collection to
release appExcel.

Thanks, in advance.


  #2   Report Post  
Posted to microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.excel.programming,microsoft.public.officedev
external usenet poster
 
Posts: 1
Default .NET application does not release Excel

Try Marshall.ReleaseComObject after quit..

Thanks.

"Cameron Eckman" wrote in message
...
Let me prefix with, I've done many VB6 and ASP applications that read
from/write to Excel and have never had a problem. I'm not a beginner at
this...

I have created my first .NET Windows application that reads from Excel

2000
and writes to a tab file. I am using the code below and when stepping
through the appExcel.Quit() is executed. However, the EXCEL.EXE process
still runs and will run until I close the .NET application I've built.

This
happens in both DEBUG and RELEASE compilations.

Try
appExcel = New Excel.Application()
... coding tasks ...

Catch ex As Exception
... error tasks ...

Finally
appExcel.Quit()

Any ideas why Excel is not being released after the quit? I even tried
adding GC.Collect() to see if it helps to force the Garbage Collection to
release appExcel.

Thanks, in advance.




  #3   Report Post  
Posted to microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.excel.programming,microsoft.public.officedev
external usenet poster
 
Posts: 1
Default .NET application does not release Excel

Because Excel is a COM based application, I'm wondering if you don't need to
manually destroy the Excel object reference like in the COM world:

Finally
appExcel.Quit()
appExcel = Nothing
End Try


"Cameron Eckman" wrote in message
...
Let me prefix with, I've done many VB6 and ASP applications that read
from/write to Excel and have never had a problem. I'm not a beginner at
this...

I have created my first .NET Windows application that reads from Excel

2000
and writes to a tab file. I am using the code below and when stepping
through the appExcel.Quit() is executed. However, the EXCEL.EXE process
still runs and will run until I close the .NET application I've built.

This
happens in both DEBUG and RELEASE compilations.

Try
appExcel = New Excel.Application()
... coding tasks ...

Catch ex As Exception
... error tasks ...

Finally
appExcel.Quit()

Any ideas why Excel is not being released after the quit? I even tried
adding GC.Collect() to see if it helps to force the Garbage Collection to
release appExcel.

Thanks, in advance.




  #4   Report Post  
Posted to microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.excel.programming,microsoft.public.officedev
external usenet poster
 
Posts: 1
Default .NET application does not release Excel

"Cameron Eckman" wrote in message
...

<snip

Any ideas why Excel is not being released after the quit? I even tried
adding GC.Collect() to see if it helps to force the Garbage Collection to
release appExcel.

Thanks, in advance.


Knowledge Base Artice: PRB: Office Application Does Not Quit After
Automation from Visual Studio .NET Client

http://support.microsoft.com/?kbid=317109

Erik


  #5   Report Post  
Posted to microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.excel.programming,microsoft.public.officedev
external usenet poster
 
Posts: 2
Default .NET application does not release Excel

Thanks. I also found the following article:
http://support.microsoft.com/default...b;en-us;317109

I am still having problems, but it seems to do with looping through the
cells. I'll have to do
ReleaseComObject after I'm done with each cell. What a pain in the....


"Shailesh [MVP]" wrote in message
...
Try Marshall.ReleaseComObject after quit..

Thanks.

"Cameron Eckman" wrote in message
...
Let me prefix with, I've done many VB6 and ASP applications that read
from/write to Excel and have never had a problem. I'm not a beginner at
this...

I have created my first .NET Windows application that reads from Excel

2000
and writes to a tab file. I am using the code below and when stepping
through the appExcel.Quit() is executed. However, the EXCEL.EXE process
still runs and will run until I close the .NET application I've built.

This
happens in both DEBUG and RELEASE compilations.

Try
appExcel = New Excel.Application()
... coding tasks ...

Catch ex As Exception
... error tasks ...

Finally
appExcel.Quit()

Any ideas why Excel is not being released after the quit? I even tried
adding GC.Collect() to see if it helps to force the Garbage Collection

to
release appExcel.

Thanks, in advance.






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
Excel 5.0 release C update Terry B Excel Discussion (Misc queries) 10 August 31st 06 05:38 PM
Are you an Excel pre release 12 user?? gord Excel Discussion (Misc queries) 5 July 30th 06 03:56 PM
Excel 12 New Release Bart Vwb Excel Discussion (Misc queries) 5 October 4th 05 10:07 PM
How to release the EXCEL.EXE procedure? Serge[_2_] Excel Programming 0 September 23rd 03 05:12 PM


All times are GMT +1. The time now is 09:15 AM.

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"