Excel.exe does not leave memory when called from Web Service

J

John Bailo

I wrote a c# web service that creates an Excel spreadsheet. Even
though I follow all the formal procedures for closing the app and
finalizing, an instance of Excel still remains in memory. Is this a
problem? With that instance of Excel.exe eventually go away because of GC?

I follow the procedures described here:

http://blogs.geekdojo.net/richardhsu/archive/2003/11/14/281.aspx

I converted this app to a console app, and in this case Excel.exe does
leave the task list. But when run as a web method, Excel.exe stays
there with IUSR_ as the owner. I'm trying to get rid of this
instance once the method ends.
 
W

Willy Denoyette [MVP]

John Bailo said:
I wrote a c# web service that creates an Excel spreadsheet. Even though I follow all the
formal procedures for closing the app and finalizing, an instance of Excel still remains
in memory. Is this a problem? With that instance of Excel.exe eventually go away
because of GC?

I follow the procedures described here:

http://blogs.geekdojo.net/richardhsu/archive/2003/11/14/281.aspx

I converted this app to a console app, and in this case Excel.exe does leave the task
list. But when run as a web method, Excel.exe stays there with IUSR_ as the owner.
I'm trying to get rid of this instance once the method ends.



This is the result of using Office products with automation at the server side, these
applications were not designed and are not supported in such scenarios.
More detailed info:
http://support.microsoft.com/default.aspx/kb/257757

Willy.
 
J

John Bailo

Willy said:
This is the result of using Office products with automation at the
server side, these applications were not designed and are not supported

Yes, I know.

But Microsoft does not leave me with options other than buying some
expensive 3rd party component.

I simply want to write data from a database to an Excel file.

Is there a way this can be done?

Why is it so impossible?
 
G

Guest

I understand this isnt a Visual Studio group ... but are you using Visual
Studio 2005 for your developement? VSTO (Visual Studio Tools for Office) is
included with the Team Edition. I think you have to buy VSTO separately if
you have VS Pro. I use VSTO with code behind when need be and it's very nice
and simple to use. It's what you need. Check it out.

PWA
 
W

Willy Denoyette [MVP]

PWA said:
I understand this isnt a Visual Studio group ... but are you using Visual
Studio 2005 for your developement? VSTO (Visual Studio Tools for Office) is
included with the Team Edition. I think you have to buy VSTO separately if
you have VS Pro. I use VSTO with code behind when need be and it's very nice
and simple to use. It's what you need. Check it out.
No it's not, what the OP is trying to achieve has nothing to do with VSTO.

Willy.
 
G

Guest

I've encountered this problem; it usually come about when:

1. When using automation , you do not call Application.Quit
2. You call Application.Quit but did not take care to end other objects
below the hierarchy of the Application object before calling Quit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top