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

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?

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.

  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.

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?

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.

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)

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.

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

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).