How to test for LO version in Calc macro?

I have a macro that only works correctly in LO 4.0.1.2

I would like to be able to test that the user has this (or later) version installed.

I thought that the cell formula "=INFO(“release”) might help but that only produces the unhelpful string “84102822e3d61eb989ddd325abf1ac077904985”

How can I test for the version of Libre Office in my macro?

Hi,

Do you want to know how to get LO Version using macro?
If so, you use “GetSolarVersion” or “com.sun.star.configuration.ConfigurationProvider” / “com.sun.star.configuration.ConfigurationAccess”.
However, 4.0.12 will return value as 4.0.0.
You can see the following URL for the sample code;
http://openoffice3.web.fc2.com/OOoBasic_General.html#OOoGO18c

Fabulous. Many thanks.