Calc Macro only runs on some machines.

LibreOffice 5.2.6.2, Windows 10 (all four machines).

I have written a macro which is saved in a document. When I open the document on two of the machines I use the macro executes properly, but when I open it on two other machines the macro reference generates a #NAME? error until I carry out the following procedure on these machines:

Open the macro organizer, select the module which contains the macro, and close the organizer.
Return to the sheet, edit ANY PART of the formula which contains the macro reference (e.g. remove and retype any character). The macro then runs (and the macro name changes automatically to upper-case).
However, references to the macro in other cells still cause the #NAME? error (and the macro name is still in lower-case) - it is necessary to repeat the editing process in each cell, or copy/paste (or fill) the changed formula into the other cells.

After saving and reopening the document the macro again won’t run.
Any suggestions?

Partially solved:
The document was called “Master.ods”.

The macro was stored in that document, in Master.ods/VBAProject/Modules/Module1. I edited the macro, and copied the macro code.

I then copied the macro into My Macros/Standard/Module1(by editing Main, and pasting the code from above).

After saving and reloading the document, all macros worked perfectly.

I had tried using the macro Organizer, with no success. It seems to me that the problem is in getting Calc to recognise where the macro is stored, which would explain why each of my methods worked. A full solution would solve that problem.