How to release excel from memory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
try calling Marshal.ReleaseComObject(objExcel) before setting it to nothing.

hope that helps..
Imran.
 
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. Or
http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp

-Mike
 
Back
Top