Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Kill Excel Process via VB Script

Posted on 2013-10-22
2
Medium Priority
?
1,082 Views
Last Modified: 2013-10-22
Using vbscript - looking for a script to kill background instances of Excel.

I have a vbscript that opens an Excel file.  If it errors, Excel stays open in the background, which I don't want.
0
Comment
Question by:patriotpacer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
patriotpacer earned 0 total points
ID: 39591692
0
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39591709
Hi,

Why can't you close them when it errors

   Sub MyMacro()

        On Error GoTo ErrorHandler
        
        Exit Sub

   ErrorHandler:
        ObjExcel.Quit
        Set ObjExcel = Nothing
        Exit Sub

   End Sub

Open in new window

Regards
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Six Sigma Control Plans
Introduction to Processes
Suggested Courses

610 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