Warning message when using macros in Impress

I’ve recently started trying to use macros in Impress (running MX Linux, an Ubuntu derivative), but I’m getting serious warnings similar to the following:

It might be dangerous to open "vnd.sun.star.script:Standard.Module1.Hide?language=Basic&location=application". Do you really want to open it?

These seem to only occur when I reopen a previously saved file, not when I’ve just added them to a new file.

They occur when using different versions of LibreOffice - the default version in MX Linux is 7.4.7.2, but I’ve also got 24.2.3.2 installed on my system.

And I can’t find any way to disable them. Adding the path to the directory where they’re located to “Trusted Sources” has no effect, and nor does using a low security setting.

Is there any way to remove these warnings?

(Note: This is similar to the question here. However, I’m trying to do something different, using a different component of LibreOffice on a different system, and that post is quite old and apparently unresolved.)

Add some (any) even empty Sub Main / End Sub macro to the document, then your macro security and trusted location settings should be used and if they allow macro execution then this “dangerous link” question will not be asked. It doesn’t pop up with a new document because LibreOffice knows that you are the author.

Thank you! I managed to get it working properly.