Code to change the assigned macro of a button control on a sheet

I have created a push button on a sheet and have assigned it a macro to run when clicked. I can change the label of the button after it is clicked.

I am trying to use code to assign a different macro to it after it is clicked, but am having no luck. Any suggestions would be appreciated.

I am running LO 26.2.0.3 on Ubuntu 24.04.1 LTS.

Thanks in advance.