Groups | Blog | Home
all groups > dotnet general > october 2004 >

dotnet general : How to release excel from memory


Anu
10/28/2004 8:14:01 PM
i am using ASP.net to read one excel file.
after reading the excel file cell by cell, i am not able to release the excel.
i am using
objExcel.Application.Quit()
objExcel = Nothing

but still excel is not releasing from memory

thanx in advance

Anu
Imran Koradia
10/28/2004 11:49:41 PM
try calling Marshal.ReleaseComObject(objExcel) before setting it to nothing.

hope that helps..
Imran.

[quoted text, click to view]

Mike S.
10/29/2004 3:54:02 PM
Anu,
I tried and tried to get this same functionality from asp.net using Excel
2000 and never did get to a point where it would release properly. Apparently
some people have. It depends on what objects you open, how you open them and
the order you release them in. I read that someone used API calls to release
the object - Ok if you want all instances shut down but not a good thing if
you have the probability of more than one instance being instantiated.

Take a look at this good article by Steve C. Orr
http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp

-Mike

[quoted text, click to view]
AddThis Social Bookmark Button