Close External Apps Issue

C

Chris

I coded this macro to close two external applications when activated.
The macro was working perfectly fine before but now it fails to send
the SendKeys properly and neither application closes. I don't know if
it is an issue with the coding or due to computer related issues.

The code I used is:

Sub CloseApp()
AppActivate "X"
SendKeys "%{F4}"
Application.Wait (Now + TimeValue("0:00:01"))
SendKeys "~"
Application.Wait (Now + TimeValue("0:00:05"))
AppActivate "Y"
Application.Wait (Now + TimeValue("0:00:01"))
SendKeys "%{F4}"
End Sub

Substituted "X" and "Y" for the actual app names.

Thanks for your help in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top