I want to call multiple AHK scripts in Excel VBA sequentially.
Is there any command or code for that?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The following will run an AHK script:
shell("C:\Program Files\AutoHotkey\AutoHotkey.exe ""C:\Path\To\Script\AHK_Script.ahk""")
If you need for the VBA to wait until the AHK script finishes, you could try using the following from https://stackoverflow.com/a/15952009:
Dim wsh As Object Set wsh = VBA.CreateObject("WScript.Shell") Dim waitOnReturn As Boolean: waitOnReturn = True Dim windowStyle As Integer: windowStyle = 1 wsh.Run "C:\folder\runbat.bat", windowStyle, waitOnReturn