Avatar of Stephen Forero
Stephen Forero
Flag for United States of America asked on

close running exe from vba

In vba from excel, I launch a exe file which is just a windows userform with a animated gif on it.
using shell("xxxxx")
I'm stuck on finding the vba command to close this running app.
anyone know how to close it?

thanks
Microsoft ExcelVisual Basic Classic

Avatar of undefined
Last Comment
Stephen Forero

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
tipsybroom

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Stephen Forero

ASKER
thanks... very long but I cut it down to
Set objWMIcimv2 = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\.\root\cimv2") 'Connect to CIMV2 Namespace
     
    Set objList = objWMIcimv2.ExecQuery _
    ("select * from win32_process where name='" & strTerminateThis & "'") 'Find the process to terminate
     
    For Each objProcess In objList
        intError = objProcess.Terminate 'Terminates a process and all of its threads.
    Next

Open in new window

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck