There sure be an environmental variable somewhere related with the application build version that will have the libreoffice / openoffice delimiter. One way is to consult the Setup.xcu of the product. Here is a forum post with a python script that looks there, however this is for PyUNO des. a Basic should in theory be simpler. https://forum.openoffice.org/en/forum/viewtopic.php?f=44&t=19202
On Sun, Oct 19, 2014 at 2:06 PM, Johnny Rosenberg <gurus.knu...@gmail.com> wrote: > Here's my problem: > > I have both Apache OpenOffice and LibreOffice installed and I use them > both. I have quite a few Calc files with Basic macros. Today I found my > first difference between the Basic API in LibreOffice vs. Apache > OpenOffice: > > Dim Dlg As Object, Ctl As Object > DialogLibraries.LoadLibrary("Standard") > Dlg=CreateUnoDialog(DialogLibraries.Standard.ElDialog) > Ctl=Dlg.getControl("DateField") > > Now, I want to use Ctl.setDate(myDate) and myDate=Ctl.getDate(), and here's > the difference: > In Apache OpenOffice, myDate is a Long. Today's date, 2014-10-19, is > represented as 20141019. I made two functions to convert to and from the > format I needed. > > When running my macro in LibreOffice, the macro was interrupted by an error > message, of course. After some debugging I found that the LibreOffice > version of Ctl.setDate/Ctl.getDate works with a struct: > Type DateType > Year As Long > Month As Long > Day As Long > End Type > > > This is of course not a big deal, I can make the macro accept both formats, > but the macro need to know if LibreOffice or Apache OpenOffice is running > it. How can I do that? I have tried to find the answer myself, both using > xray and searching the web, but so far nothing. > > > Kind regards > > Johnny Rosenberg > ジョニー・ローゼンバーグ > -- Alexandro Colorado Apache OpenOffice Contributor 882C 4389 3C27 E8DF 41B9 5C4C 1DB7 9D1C 7F4C 2614