473,396 Members | 2,070 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,396 software developers and data experts.

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



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...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.
Feb 26 '07 #1
7 2398
"John Bailo" <ja*****@texeme.comwrote in message
news:za******************************@speakeasy.ne t...
>

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...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.
Feb 26 '07 #2
Willy Denoyette [MVP] wrote:
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?
Feb 26 '07 #3
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

"John Bailo" wrote:
Willy Denoyette [MVP] wrote:
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?
Feb 26 '07 #4
"PWA" <PW*@discussions.microsoft.comwrote in message
news:2B**********************************@microsof t.com...
>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.

Feb 26 '07 #5
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.
Feb 26 '07 #6
John Bailo wrote:
Willy Denoyette [MVP] wrote:
>This is the result of using Office products with automation at the
server side, these applications were not designed and are not supported
>
Is there a way this can be done?
Here's a thread that documents this same problem exactly:

http://www.vbforums.com/showthread.php?t=396405

His solution is to use GetWindowThreadProcessID to find and kill the
hanging Excel.exe.

I like it!
Feb 26 '07 #7
John Bailo wrote:
Is there a way this can be done?
Here's a more define article:

http://forums.microsoft.com/MSDN/Sho...PostID=1010842

It confirms that others are having this problem/issue even when writing
orthogonal code to close Excel.
Feb 26 '07 #8

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

Similar topics

10
by: Lars-Erik Aabech | last post by:
Hi! This issue have been discussed a lot, but I haven't found a solution that applies to ASP.NET. I have a library which does some operations on Excel documents, and it will be used in an...
3
by: hkappleorange | last post by:
I connect to mdb file using the following codes. How should I modify it if I want to connect to Excel instead ? <%@ Import Namespace="System.Data.OleDb" %> <% Dim conAuthors As...
6
by: Rich Wallace | last post by:
Hi all, I have a VB app that runs and manages individual XLS files within a single COM object. Upon processing the final fie, I attempt to close out the EXCEL object and release it using...
8
by: Sam | last post by:
Hi All, I posted this message few days ago. No one has answered so far. I just would like to know if it is possible to do or not. Even if you can not tell me how to do this, maybe you know which...
15
by: John Machin | last post by:
I am pleased to announce a new general release (0.5.2) of xlrd, a Python package for extracting data from Microsoft Excel spreadsheets. CHANGES: * Book and sheet objects can now be pickled and...
5
by: mabond | last post by:
Hi recently read a posting and reply about Excel processs still running after the Appliction.Quit was called. Thought I might be able to use the same...
1
by: John Bailo | last post by:
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...
1
by: John Bailo | last post by:
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. I...
22
by: robertgregson | last post by:
Using C#, .NET3.5, Visual Studio 2008 and WCF on Windows VISTA SP1, I have written a service, service host (as a C# console application) and a client. The service uses...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.