I want to call multiple AHK scripts in Excel VBA sequentially.

Is there any command or code for that?


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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.