Ask Your Question

What do I need for Libreoffice macros to work on Windows 7?

asked 2016-10-14 10:12:19 +0100

martink gravatar image

I want to develop a simple Libreoffice macro which will use the "advanced filter" functionality in Calc. The spreadsheet containing this macro will have to be very widely distributed over many PCs over whose configuration I have no control. So my first question is, can I rely on Windows 7 having a JRE installed which will be compatible with LibreOffice? My memory is that Microsoft stopped installing a JRE by default, and so it would have to be installed separately. My second question, is there a possibility of embarking a JRE (or perhaps something else like Python) in the spreadsheet itself, so that I can just distribute the spreadsheet and be certain that all the necessary components will be there with it?

edit retag flag offensive close merge delete


While true Micro$oft had a Java Virtual Machine of its own, it was incomplete Sun Java 1.1 designed to run Java applets in Internet Explorer >=3 that was inclusive in 2k and had higher performance than Sun's, it was discontinued before XP so Sun wouldn't keep on suing. Thus you couldn't use it as well as Sun Java 1.1 even if you tried.

rautamiekka gravatar imagerautamiekka ( 2016-10-14 13:41:30 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2016-10-14 13:16:24 +0100

gabix gravatar image
  1. A JRE must be installed separately.
  2. A core Python interpreter is installed with LibreOffice.

Thus, in your case a Python or StarBasic macro looks like a better solution as compared to Java-based.

edit flag offensive delete link more


If a core Python interpreter is installed with Libreoffice (since what version?) That seems the way to go. However, macro recording only seems possible in Libreoffice Basic which requires a JRE. It seems that to use a Python macro I have to develop outside Libreoffice and then somehow include it in the document. Is that so?

martink gravatar imagemartink ( 2016-10-17 10:59:23 +0100 )edit

A core Python interpreter has been a part of OOo/AOO/LO for quite a long time (no idea since when exactly). Macro recording does not require a JRE (why would it?). As for including Python macros into documents, frankly, I don't know. There is a tutorial that suggest direct adding of Python scripts into spreadsheets, but I did not test it.

gabix gravatar imagegabix ( 2016-10-17 11:47:39 +0100 )edit

Well, I don't know why it would but when I tried to record a macro at first Libreoffice told me I had to switch on the JRE first. And I cannot find any way to record a macro in Python, you only seem to be able to save it in Libreoffice Basic format (which I suppose would explain why you would have to have the JRE, since as I understand it LO Basic requires the JRE)

martink gravatar imagemartink ( 2016-10-17 15:23:34 +0100 )edit

Strange, a JRE is a must only for the database part of LO and for a couple of wizards. And no, recording a macro in Python is not possible, you have to code it from scratch.

gabix gravatar imagegabix ( 2016-10-17 16:16:35 +0100 )edit

I have just checked macro recording with Java switched off in LO settings. It worked (LO on Windows 7).

gabix gravatar imagegabix ( 2016-10-17 16:18:22 +0100 )edit

I had the same experience - the problem I first encountered was on my Mac. But then if you need a JRE to run macros surely it makes sense to have it also when you record them? Otherwise how do you test? At all events, the whole thing seems weird to me: why not have a macro recorder that produces Python since that is the interpreter that is embarked with the software (rather than Libreoffice Basic which I find uttermy incomprehensible, I doubt I'm the only one).

martink gravatar imagemartink ( 2016-10-19 16:35:09 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-10-14 10:12:19 +0100

Seen: 229 times

Last updated: Oct 14 '16