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

Discussion in 'ASP .Net Web Services' started by John Bailo, Feb 22, 2007.

  1. John Bailo

    John Bailo Guest

    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/archive/2003/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!
    John Bailo, Feb 22, 2007
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >
    > 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/archive/2003/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!
    >
    >
    >
    Mark Fitzpatrick, Feb 23, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. \Rob\
    Replies:
    0
    Views:
    416
    \Rob\
    May 10, 2004
  2. Tim Marsden
    Replies:
    11
    Views:
    949
    Steven Cheng[MSFT]
    Jun 3, 2004
  3. Replies:
    3
    Views:
    755
    Adam P. Jenkins
    May 1, 2005
  4. zr
    Replies:
    18
    Views:
    2,009
    James Kanze
    Mar 28, 2009
  5. Terry Ledwith

    Dbase remains open after closing FP98

    Terry Ledwith, Aug 22, 2003, in forum: ASP General
    Replies:
    0
    Views:
    98
    Terry Ledwith
    Aug 22, 2003
Loading...

Share This Page