473,385 Members | 1,655 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,385 software developers and data experts.

Excel instance remains after closing, calling GC, setting to null


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 follow the procedures described here:

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

Yet, excel.exe stays there with IUSR_ as the owner.

I'm trying to get rid of this instance once the method ends.

BTW -- if I use the exact same code in a c# console application, the
instance does go away!

Feb 22 '07 #1
1 1682
You're also positive you're clearning all the com references as mentioned in
the comments to that entry. Keep in mind, Excel should never really be used
on the server. It's not designed to be called from ASP.Net or a web service.
It's the wrong threading model. You can end up with numerous copies of Excel
running and MS doesn't recommend this at all. There are lots of third-party
components that are written in managed code and may do what you need.
Personally, I've used the one from Component1 but there are lots of others
out there.
--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"John Bailo" <ja*****@texeme.comwrote in message
news:Je******************************@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.

I follow the procedures described here:

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

Yet, excel.exe stays there with IUSR_ as the owner.

I'm trying to get rid of this instance once the method ends.

BTW -- if I use the exact same code in a c# console application, the
instance does go away!

Feb 23 '07 #2

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

Similar topics

2
by: Jim | last post by:
OK, now I'm really stumped. I have a ASP.NET w/ C# application that is using Excel XP to do automation. Everything works just great, but Excel stays resident in memory after I try to .Quit(). I...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
0
by: rhett | last post by:
howdy folks, first off, I'd like to not that I have browsed the forums and thanks to what I've found there I'm 80% through this problem, but the last part seems to be a profound obstacle and any...
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...
20
by: Atchoum | last post by:
I have a DLL that opens an Excel workbook and add-in. If I close the app that calls the DLL before closing Excel, when I close Excel everything is fine. But if I close Excel while the app is still...
16
by: alexia.bee | last post by:
Hi all, In some weird reason, excel instance won;t die if i remove the comment from 4 lines of setting values into struct. here is a snipcode public...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
10
by: Hendri Adriaens | last post by:
Hi, I'm trying to automate the creation of an excel file via COM. I copied my code below. I read many articles about how to release the COM objects that I create. The code below runs just fine...
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: 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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.