View Single Post
 
Old 02-07-2019, 10:19 AM
josh2008 josh2008 is offline Windows XP Office 2016
Novice
 
Join Date: Feb 2019
Posts: 2
josh2008 is on a distinguished road
Default Is it possible to call a common vba macro on a commandbutton ?

Hi
Hope this can be done is Word etc (I can in LibreOffice etc).
I wish to use many command buttons in a document, these buttons basically control external hardware. I would need to call a VBA code that gets the caption from the sending button and then send this caption to a shell program.

I can create a button, but I cannot assign any events as such, I can create the code; but this for each button.


I would like to be able to copy paste a button, and just change the caption for the new button for it to work.


I cannot find a way to use a custom macro with the button click event.


Button I am using, is Legacy CommandButton


Hope that makes sense.
Reply With Quote