Ask Your Question

How to know which CommandButton called the macro?

asked 2018-09-03 23:19:11 +0200

shma_lo gravatar image

Imagine, I have create the calc dialog with several CommanButtons and I want to connect all of them to the same macro. While this macro is running, how can I know which CommandButton called this macro?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-09-04 00:22:50 +0200

Ratslinger gravatar image


Attached is a sample demonstrating this. The macro uses oEvent.source to obtain the control Model. In the model you can examine the control name or the button label to determine which was pressed. The sample demos both.

Sample ------ DialogButtonPressed.ods

edit flag offensive delete link more


Thank you very much. This is exactly what I wanted.

shma_lo gravatar imageshma_lo ( 2018-09-04 03:07:26 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-09-03 23:19:11 +0200

Seen: 47 times

Last updated: Sep 04 '18