I don't understand why I am seeing this warning whenever I open document. How to resolve this issue?

A week ago I tried to create a macro to a thing which I do daily. That thing is, every time I write code inside a Test Box, I colorify the code using an extension name Code Highlighter. IF I use Java, then I have to go to Tools > Highlight Code > J > Java. To do this every time, it’s really time-consuming and very annoying. So I thought, why don’t I use a Macro for this and assign a shortkey for it like how I do things in IntelliJ Ultimate IDE or any other IDE. I did that, it didn’t work as I expected. And this is what I get every time when I open Java 5th sem.odt, the same document which I used to record Macro.

Note: It happens in that particular document.

Distro: Ubuntu 19.10
LO version: 6.3.3.2
Format of doc: .odt

Screenshot of error message

Is it possible to create a Macro for what I was trying to do doing?

Hello,

this is due to default macro security level High and missing “Trusted File Location” - Go to Tools -> Options -> LibreOffice -> Security -> Button: Macro Security ... -> Tab: Trusted File Locations -> Button: Add and select the directory, where your file is being stored. This should prevent this warning to occur (and enabling the execution of macros within files stored in that trusted directory)

I strongly recommend to not add multipurpose directories like ..\Downloads, ..\Temp, etc to “Trusted File Locations”

You could also lower the security level (which I absolutely don’t recommend to do) at Tools -> LibreOffice -> Security -> Button: Macro Security ... -> Tab: Security Level

Hope that helps.

If the answer is correct or helped you to solve your problem, please click the check mark (:heavy_check_mark:) next to the answer.

@anon73440385 There is no “LibreOffice” option inside Tools.

But there is Tools > Options > Security>Macro Security …

And I added /home/Documents/BCA folder in “Trusted File Locations”. The thing is the so-called Macro I created doesn’t work as I mentioned in the post described above.

How can I delete that? How does macro works? I was hoping to create a custom shortkey using Macro, is it not possible?

Sorry .- for leaving off → Options → my bad an corrected …

Why do you post a macro error and ask why I am seeing this warning whenever + How to resolve this issue while in fact you are interested in how to create a working macro. I got no solution for questions not being asked … Bye