We will be migrating from Ask to Discourse on the first week of August, read the details here

# Is there a process to allow Macros from excel to work in Calc?? [closed]

This post is a wiki. Anyone with karma >75 is welcome to improve it.

We have users that are trying to open Excel spread sheets in Calc. The sheets have Macros in them that are throwing the error below:

"This document contains macros. Macros may contain viruses. Execution of Macros is disabled due to the current macro security setting in tools-options-libreoffice-security"

Now I have tried to adjust this setting without success, this seems to be a running theme with our sheets with Marcos as this is not the only instance of this in our environment.

Any direction that anyone can provide would be appreciated!!!

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2021-05-04 13:35:14.463344

1

Posting questions in the wiki mode is not recommendable, imo.

( 2018-01-10 17:23:34 +0200 )edit

Sort by » oldest newest most voted

The message "This document contains macros. Macros may contain viruses. Execution of Macros is disabled due to the current macro security setting in tools-options-libreoffice-security" does not indicate an error, but informs about a setting. The setting itself should also prevent LibO from excuting Openoffice macros contained in the file.

The setting concerned is to find here: Tools > Options > LibreOffice > Security > Macro Security >> open the dialogue
If you want to allow the execution of macros after having answered a prompt, you need to choose 'Medium' there.

If an Excel-VBA macro can successfully run then under LibO depends heavily on details.

(edit: fixed Macro Security location typo -AK )

more

thank you, I will try this out and report back...may I ask what details that would be, would they have to re-write the macro in some way to work inside Calc??

( 2018-01-10 18:28:23 +0200 )edit

VBA on the one hand and LibO/AOO BASIC on the otheer hand are rather similar. The problem, however, does not mainly lie in the programming language, but in the way to access the objects of the respective documents. LibO does this via an elaborate API and its BASIC itself offers only very few specialised elements. Excel/VBA on the other hand are highly integrated. Some concepts look basically incompatible, and for me it's strange that there is at all a VBAsupport mode working to some degree.

( 2018-01-10 18:45:54 +0200 )edit

Ordinary functions for use in formulae on the other hand can sometimes be identical, and can run in both the softwares independent of a special compatibility mode. Concerning functions (disregarding side effects) the most relevant difference (imo) is that VBA has access to the CellRange object for a parameter given as a simple reference, while in Calc only the data are accessible then.

( 2018-01-10 18:53:15 +0200 )edit

At present there seems to be no way to enable macros for VBS Applications. The path referenced "Tools > LibreOffice > Security > Macro Security >> open the dialogue" does not exist in LibreOffice 5.4.

Microsoft continues to change what is available in VBS which requires a script engine (interpreter instead of compiled machine app). That being said it will take a continuous team of software engineers to keep up. Would not expect this to happen as long as Microsoft abides a philosophy of NO STANDARDS AND CONVENTIONS EXCEPT THEIRS WITHOUT LETTING US KNOW WHAT THEIRS ARE.

So at present there is not a way to allow ALL macros run.

more

1

"there seems to be no way to enable macros" is quite different from "The path referenced "Tools > LibreOffice > Security > Macro Security >> open the dialogue" does not exist", because the latter only means a typo in the path, which should read Tools > **Options** > LibreOffice > Security > Macro Security

( 2018-04-01 22:13:11 +0200 )edit