-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: rags_rao
Message 3 in Discussion


well,


app.Quit(); //app is an 
excel application object 

Marshal.ReleaseComObject(app);  

 app = null;

//next 2 
lines not really required.xtra precaution

GC.Collect(); 

GC.WaitForPendingFinalizers();
This 
code will make sure that excel object is killed. 
BUT! 
you will see one instance of excel.exe running in task manager running all the 
time after first excel object is created,which is 
acceptable (which is better than having one excel.exe per object 
created and this number keeps increasing till server 
crashes).
if you 
observe in task manager for each new excel object u create a new excel.exe entry 
appears in task manager but it disappers once the code given above executes, but 
one instance will always be seen
 
'nother thing to note here is if the MS-Excel Application itself is 
opened (manually), excel (object in your code) starts throwing error (dont ask 
me why). but then in production environment, nobody will sit 
and play with spreadsheet on the server will they?
 
summary: 
1. use 
the code above - it will make sure there is only one instance of excel running, 
which i think is a logical and workable 
solution.
2. 
Dont open excel (office application) manually on server, which is not too 
much to ask for.
 
follow 
these 2 steps and every thing should work fine

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to