ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close External Apps Issue (https://www.excelbanter.com/excel-programming/431180-close-external-apps-issue.html)

Chris

Close External Apps Issue
 
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.


All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com