Solved

Kill Excel Process via VB Script

Posted on 2013-10-22
2
985 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
2 Comments
 

Accepted Solution

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compile Error 7 53
VB Script: restart service function 30 36
Cygwin - GNU GPL License 1 25
VBA: copy range dynamically based on config sheet v2 3 35
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.

831 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