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

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

mainrotorAsked:
Who is Participating?
 
RickCommented:
Dim pr() As Process = Process.GetProcessesByName("excel")

For Each p As Process In pr
       p.CloseMainWindow()
Next
0
 
Éric MoreauSenior .Net ConsultantCommented:
you should stay away from Excel (specially on a server). check http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
0
 
CodeCruiserCommented:
Try adding

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


Do this before setting the objects to null.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.