Page 1 of 1

Macros and UI

Posted: Wed 7. Feb 2024, 10:25
by scope
is there a way to map a button to run a Macro ?

Re: Macros and UI

Posted: Wed 7. Feb 2024, 12:01
by M.Maidhof
yes, simply put the name of the macro in the “Execute Command” property of the button. But note: this will only work when no other macro is working in that time and the macro is already available in the macro list.

regards

Michael

Re: Macros and UI

Posted: Mon 2. Sep 2024, 12:54
by dmeir
I cannot get my VBS macro to run this way.
The macro is loaded in the Project Manager, and no other macro (that I know of) is currently running.
I also can't add the macro to the "macro list" because it says "this macro is already loaded".
In the “Execute Command” property of my button I put the macro's filename without extension, as shown in the Project Manager's "Macros" list.

Bonus question: how do I only run a specific function out of a VBS macro file?

Re: Macros and UI

Posted: Mon 2. Sep 2024, 13:53
by M.Heidemann
Hello,

You enter the name of a subroutine, not the Macro-File.

For example:

Code: Select all


Sub doSomething()

PrintToOutputWindow "Hello!"

End Sub

in the execute Command property you just enter the name of the subroutine:

Code: Select all

doSomething
(Notice: No Parenthesis, no Quotes).

Try again and let us know if it works now.

BR

Marvin

Re: Macros and UI

Posted: Thu 5. Sep 2024, 12:08
by dmeir
Thanks, this works.
I'll add that one has to use the complete name of the function including underscores (somewhere in the forum or documentation it was suggested that one has to remove the underscores).