473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Office automation cleanup (Excel)

Hi all,

Just playing around a MS how-to sample to work with an Excel file from
within C#. Everything is fine and I understand it OK, however when Excel
and the application are closed, there is still an Excel process showing
up in the task manager. Every time the app is run, another process shows
up for Excel and always stays there. The only way to get rid of it is to
kill it manually.

So my question is, what is the correct way of cleaning up after
launching Excel from a C# app? Closing Excel and quitting the
application is obviously not enough.
Nov 16 '05 #1
3 4495

Check this knowledge base article.

Office application does not quit after automation from Visual Studio
..NET client
http://support.microsoft.com/default...b;en-us;317109

When you run the code in this article, the Excel is removed from
memory, just as the article predicts.

When I added one line with the SaveAs command, it failed to be
removed from memory. My project involving Excel automation always left
Excel in memory. I never could solve it.

If you get a solution, please post it.

There is also a "microsoft.public.dotnet.framework.interop" group that
may have more help.
Paul Sullivan
On Thu, 17 Feb 2005 10:55:09 +1100, Stephen Brooker
<us****@REMOVETHISeclecticgeek.net> wrote:
Hi all,

Just playing around a MS how-to sample to work with an Excel file from
within C#. Everything is fine and I understand it OK, however when Excel
and the application are closed, there is still an Excel process showing
up in the task manager. Every time the app is run, another process shows
up for Excel and always stays there. The only way to get rid of it is to
kill it manually.

So my question is, what is the correct way of cleaning up after
launching Excel from a C# app? Closing Excel and quitting the
application is obviously not enough.


Nov 16 '05 #2
Paul Sullivan wrote:
Check this knowledge base article.

Office application does not quit after automation from Visual Studio
.NET client
http://support.microsoft.com/default...b;en-us;317109

When you run the code in this article, the Excel is removed from
memory, just as the article predicts.

When I added one line with the SaveAs command, it failed to be
removed from memory. My project involving Excel automation always left
Excel in memory. I never could solve it.

If you get a solution, please post it.

There is also a "microsoft.public.dotnet.framework.interop" group that
may have more help.
Paul Sullivan


Cool thanks Paul. I'll do some more research and see what I can come up
with. Let you know if it's anything brilliant. ;-)
Nov 16 '05 #3
FYI: It may help to know that a better version of Excel suited for interop
is located in the Microsoft Office Web Components. This instance releases
resources cleanly and is well behaved for both server and windows forms
applications.

--
Regards,
Alvin Bruney [Microsoft MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------
"Stephen Brooker" <us****@REMOVETHISeclecticgeek.net> wrote in message
news:37*************@individual.net...
Paul Sullivan wrote:
Check this knowledge base article.

Office application does not quit after automation from Visual Studio
.NET client
http://support.microsoft.com/default...b;en-us;317109

When you run the code in this article, the Excel is removed from
memory, just as the article predicts.

When I added one line with the SaveAs command, it failed to be
removed from memory. My project involving Excel automation always left
Excel in memory. I never could solve it. If you get a solution, please
post it.

There is also a "microsoft.public.dotnet.framework.interop" group that
may have more help.
Paul Sullivan


Cool thanks Paul. I'll do some more research and see what I can come up
with. Let you know if it's anything brilliant. ;-)

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: deko | last post by:
This code runs okay, but I cannot quit Excel. I've read that this may be due to the way I reference the object variables, but I don't know how else I would reference them. How do I get Excel to...
2
by: Alex Maghen | last post by:
Hi. I've seen several KBs on using .NET for MS Office Automation. But I have a particular question: I am developing a somewhat stand-alone .ASPX page which will need to do some relatively simple MS...
12
by: elziko | last post by:
I'm using late binding (I must) to automate Excel. My code opens Excel after createing and poulating some sheets. My problem is that when the user finally decides to close Excel its process is...
0
by: Marco Singer | last post by:
Hi all, I want to create an Office automation client for Office 97 (and newer) which should automate Access, Excel and Word. On my developer computer I have Office XP installed. In KB244167...
6
by: Luke Vogel | last post by:
Hi all ... could someone point me in the right direction for programming office applications (specifically excel) using vb.net? Can vb.net replace or enhance VBA that comes with the office suite?...
1
by: Alberto | last post by:
Hi all. I'd like to know if the "architect" version of Visual Studio .NET includes the environment to develop Office application. Any way is it possible to devolpo Office XP apps with VS .Net or I...
2
by: ChrisFrohlich | last post by:
I have been trying to use the Office PIA's to write an ASP.NEt page to: 1. Open a template workbook 2. Populate some data 3. Save the file back to the server 4. Quit Excel and free up Memory I...
1
by: BK | last post by:
I have a .NET Solution (currently in 2003, FW 1.1) that uses Office automation for a few things (generates a Word document, dumps datagrids to Excel, etc.). One of my programmers works on the...
12
by: Tomas | last post by:
Hi, I have worked with VB.NET for half a year (semi-newbie). Currently I am looking around for some books for those that crossed the starting hurdle. There are too many books out there-make...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.