If I setup macro security to very high I am able to put the read only template folder in the list of secure locations and running a macro on DocumentCreate works. Unfortunately the new document looses its connection with the template, so it is not possible to have a read only secure folder for macros this way after the initial creation of the document.
If I instead put all macros in a library in the installation path (/usr/lib/libreoffice/share/basic or C:\Program Files\LibreOffice\share\basic), which is again readonly for regular users, all of these macros are running fine, if (!) I start them by hand. If I attach one of these macros to a DocumentOpen event it will trigger the yellow bar stating running macros is not allowed. I find this quite inconsistent and wrong, as systemwide macros in the system folder should in my opinion be runnable no matter what.
Is there any way to get to run a macro securely, that is from a read only location, automatically on DocumentOpen?