Last post Feb 17, 2011 01:28 PM by kedarrkulkarni
Feb 17, 2011 01:03 PM|devilsgrave|LINK
We have a process where we upload an office document (ppt, doc, xls, etc) using the InterOp assemblies and once it's done it's leaving the process running in the background and it is preventing us from uploading another document. I have checked the code
and I am releasing all the objects but it's still not working. So for ex if I upload a ppt the task manager shows POWERPNT.EXE running in the background even after closing the window.
So my question is how do we kill these processes through code (VB.NET) so that it doesn't hang up the other uploads. I tried doing this at the end of the code
Dim appPPt As PowerPoint.Application ' Set a reference to the PowerPoint Application object.
appPPt = New PowerPoint.Application
If appPPt.Visible = True Then ' Close the previous presentation.
appPPt.ActivePresentation.Saved = False
appPPt.ActivePresentation.Close() ' Quit PowerPoint
appPPt.Quit() ' Close the object reference.
appPPt = Nothing
This solved the problem and it's letting me upload a new document but I still see the process in the task manager. So far now it's working but I am not sure if this is the right solution. Thanks.
Feb 17, 2011 01:28 PM|kedarrkulkarni|LINK
calling Quit method on application object should work.... theres little more u can do to kill object.... as explained in below link
hope this helps....