?
Solved

Kill Excel Process via VB Script

Posted on 2013-10-22
2
Medium Priority
?
1,065 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 52

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn different types of Android Layout and some basics of an Android App.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Progress
Suggested Courses

752 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