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

Posted on 2011-04-29
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,
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



objWkB = Nothing
objXL = Nothing

Open in new window

Question by:mainrotor
    LVL 69

    Expert Comment

    by:Éric Moreau
    you should stay away from Excel (specially on a server). check
    LVL 13

    Accepted Solution

    Dim pr() As Process = Process.GetProcessesByName("excel")

    For Each p As Process In pr
    LVL 83

    Expert Comment

    Try adding


    Do this before setting the objects to null.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    This video discusses moving either the default database or any database to a new volume.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now