We help IT Professionals succeed at work.

I need help closing an Excel process from my ASP.Net application

Medium Priority
229 Views
Last Modified: 2012-05-11
I need help closing my Excel Process(es) in my ASP.Net application.
Even after I quit and close my Excel application programmatically, I still have an EXCEL.EXE process opened.  How can I close the Process?  I have included my code in this post and an image of the running Process.

Thanks in advance,
mrotor
Process
Dim objXL As Microsoft.Office.Interop.Excel.Application
Dim objWkB As Microsoft.Office.Interop.Excel.Workbook

objXL = New Microsoft.Office.Interop.Excel.Application
objWkB = objXL.Workbooks.Open(strLastQtrPSBD12)
objXL.Visible = False

‘SOME CODE…

objWkB.Close()
objXL.Quit()

objWkB = Nothing
objXL = Nothing

Open in new window

Comment
Watch Question

Éric MoreauSenior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016

Commented:
you should stay away from Excel (specially on a server). check http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Try adding

System.Runtime.InteropServices.Marshal.ReleaseComObject(objWkB)
System.Runtime.InteropServices.Marshal.ReleaseComObject(objXL)


Do this before setting the objects to null.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.