# Get LibreOffice Version with macro

Hi, i have libre Office 6 on windows 7 x64 and i am trying to get the version of the libreoffice and whether it is x86 or x64 with basic macro on calc, but i could not find a way to do that. With the code below i can get the program version, but i also need to know if it is x86 or x64.

Sub getVersion

Dim oProdNameAccess As Object

oProdNameAccess=GetRegistryKeyContent("org.openoffice.Setup/Product")

MSGBOX oProdNameAccess.getByName("ooSetupVersion")

End sub

edit retag close merge delete

Sort by » oldest newest most voted

You find the wanted information, much more, and relevant links here:
https://forum.openoffice.org/en/forum...

(The macro demonstrated by Zizi64 in his first attachment there e.g. also works with LibreOffice 6.0,3.2)

Edit 1 regarding the comment by @pierre-yves samyn:
My answer was too rash. I since investigated the mentioned code and in specific the node /org.openoffice.Setup and couldn't find the bitwidth anywhere.

more

Hi @Lupp

I may be wrong but it seems to me that the need is not only to get the version number but to know if it's 32 or 64 bits

Regards

( 2018-04-12 16:28:57 +0100 )edit

@pierre-yves samyn: Thanks and sorry. I obviously was too lazy to read the question completely.

( 2018-04-12 22:06:57 +0100 )edit

Thanks, i will take a look on openoffice forum

( 2018-04-13 12:21:24 +0100 )edit

Hi

This is probably not the best way to proceed but, at least with Windows you should be able to do:

dim oContext as object, sUrl as string

oContext = GetDefaultContext().getByName("/singletons/com.sun.star.util.theOfficeInstallationDirectories")
sUrl = oContext.OfficeInstallationDirectoryURL

if Instr(sUrl,"x86") > 0 then
print "32"
else
print "64"
end if


Regards

more