Solved

Kill Excel Process via VB Script

Posted on 2013-10-22
2
1,002 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 50

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
printf performancy 11 71
Using Third Party DLL with Access VBA 14 41
CREATE DATABASE 3 28
Create an Excel User-form to Display Filter Results - Modify Macro 10 29
A short article about problems I had with the new location API and permissions in Marshmallow
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

832 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