AHK to VBA conversion?

Discuss other programming languages besides AutoHotkey
usser
Posts: 145
Joined: 22 Oct 2014, 13:03

AHK to VBA conversion?

12 Dec 2022, 20:30

Hello

I am looking to use VBA on some machines that will not allow any external programs like AHK.

Is there any quick guide for that like e.g. a map of VBA libraries and commands that match AHK commands?

I am looking for basic things for now such as:
1) keyboard/mouse shortcuts
2) detect cursor type
3) detect active window and/or some of its GUI elements

I can only use VBA as part of Excel/Word/Powerpoint etc and would not be possible to run e.g. any .vb standalone scripts.

Thanks!
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK to VBA conversion?

13 Dec 2022, 21:56

if u already know ahk DllCall well, u can pretty much port the code over to VBA. but there might be other limitations im not aware of, i dont use VBA
https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/declare-statement

i dont know about the things uve listed being "basic". theres probably 2k lines worth of c++ code ignoring comments running in response to every "basic" Send blablabla u write in ahk. maybe u can use ahk_h's autohotkey.dll instead and call the exported function to run ahk code from strings, instead of reproducing the c++ behavior with VBA ffi calls
usser
Posts: 145
Joined: 22 Oct 2014, 13:03

Re: AHK to VBA conversion?

16 Dec 2022, 20:32

Thanks, will I be able to use autohotkey.dll in machines that have severe restrictions like not allowing to install anything, not running cmd/powershell etc? Probably in such systems, I won't be able to run any exe.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK to VBA conversion?

16 Dec 2022, 20:37

idk, try it

Return to “Other Programming Languages”

Who is online

Users browsing this forum: No registered users and 80 guests