Activate "Edit Mode" with basic macro

Hi,
I have several Calc documents that open in read-only mode.
These are used like a template would be used, but it’s more efficient for our workflow to keep them in read-only mode.

I also have a master Calc document with a macro that copies the content of a sheet into the corresponding sheet of one of these “template” documents.

Is there a way to activate Edit Mode via a Basic macro? (Ctrl + Maj + M)
The macro works fine on a normal (editable) spreadsheet, but I get an error when the target document is in read-only mode (which I assume is expected behavior).

Thanks!

https://wiki.documentfoundation.org/Development/DispatchCommands.uno:EditDoc : Toggle Edit Mode

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dispatcher.executeDispatch(document, ".uno:EditDoc", "", 0, Array())