Buttons lose execute action

I’ve created a macro that is executed with a button it creates a pdf and another ods file, but in the new ods created the buttons don’t work. Upon inspection I noticed that execute action is no longer present. I’m using:

ThisComponent.StoreToURL(saveDir & “.ods” , Array())

to save a new copy is there a better way to do this?

there are threads that buttons block macros as they ‘steal’ the focus from relevant cells … or similar … related? in those threads workarounds are named.

What? Can you point me to those threads? I can’t seem to find them

In what way, exactly, did you create the “another ods file” where the action functionality was lacking then?
Was it done by mySpreadsheetDocument.StoreToUrl() or in a different way?
If in a different way: How did you create the button(s) there? …

It was done with a store to url. The buttons already exist in the document and already have the actions assigned to them. When I press the first button it creates a folder with the customers name and quote # and exports the quote as a pdf. It also should save the spreadsheet next the the pdf so it can be opened and updated with invoice information and then press create invoice to make a pdf of the invoice. But whenever I made the spreadsheet with the storetourl method it would just drop the execute actions on the buttons.

@vecste:

Can you point me to those threads?

some threads possibly related:
tdf#70883, tdf#115844, tdf#131317, Is there some known issues using button to execute a macro ?, Calc: Is there some known issues using button to execute a macro - II?, Copy won't work in Macro

So I created a small workaround I made a batch file that runs a copy command and instead of saving the document somewhere else I just copied it.