CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Problem when using Excel with asp.net

    Hi,
    Thanks for your view, if you could give me some suggestion, I'll be very grateful.

    I want to use Excel on the web server to create an .xls file and these codes shows how i create the excel app :
    // these codes are in c#
    Excel.ApplicationClass myExcel = new Excel.ApplicationClass();
    myExcel.Visible = false;
    Excel.WorkBooks.add(true);
    Excel.WorkBook myBook = Excel.WorkBooks[1];
    .......
    // when work finished, close it.
    myBook.close(true, "temp.xls", Missing.value);
    myExcel.Quit();
    But, after these codes, there's still EXCEL process zombies in the memory.
    How to solve the zombie process?
    Does anybody could give some suggestion?

  2. #2
    Join Date
    Dec 2002
    Location
    Birmingham, AL
    Posts
    82
    You have to call

    System.Runtime.InteropServices.Marshal.ReleaseComObject(Object o);

    after .Quit() to release it anytime you call a COM object in .NET.

  3. #3
    Join Date
    Feb 2004
    Posts
    6
    Hi, wey

    I have used that method to release my com object.

    but i still got the zombie process in memory..

    what's the reason? I don't know.

    could you give me some detail suggestion?

    thanks

    evan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured