Page 1 of 1

Pass array from ahk to VBA

Posted: 17 Dec 2017, 09:04
by zhanglei1371
Hi Everyone,I have a puzzle that stuke me for a long time.I want interactive between Excel and AHK。when I want to pass the array object from ahk to vba,I failed.the code was below,so how to pass the array object between them ?

Code: Select all

=========================ahk======================
5::
arr:=array("A","B","C")
ComObjActive("excel.application").run("Joinarr",arr)
return
===========================vba====================
Function Joinarr(arr)
    For Each a In arr
        s = s + "-" + a
    Next
    Joinarr = s
End Function
Thx for everyone!