Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index

I left this question behind for quite a while, but now I experimented a bit
more with it and I came up with the following macro example, which works
for a dialogue called ”ElDialog” including a date field called ”DateField”
that has to be created before running the macro:

Sub test
    Dim oDlg As
    Dim oCtl As
    Dim oDate As
End Sub

So the dialogue can obviously be declared as
When it comes to controls, i tdepends on what type of control. For a date
field, seems to be it.

For this to work, the enhanced IDE features must be enabled.
I can also declare a date as, rather than just Object.
When doing that, I get suggestions as I type. In the case above, when I
type ”oDate.”, I get Day, Month and Year as suggestions. That makes the
whole thing a little bit easier, I think. Maybe the macro also runs a
little faster, I don't know.

Den mån 20 nov. 2017 kl 16:41 skrev Johnny Rosenberg <

2017-11-20 0:40 GMT+01:00 Andrew Pitonyak <>:

Sorry, using my phone for this... And off the top of my head...

Each object usually supports multiple interfaces...

In basic, the actual type does not matter.

Names starting with an x refer to an interface.

I need to look it up, but I think that the preference was a variant
rather than object, but...

It may no longer matter

The developer who told me this could not remember why it when it mattered


I only had a problem because of it once, and that was years ago.

Other languages, like Java, it matters. I'd we had a smarter IDE it might
be useful to declare the actual type.

According to the little information I found, types like Variant and Object
are considered slow. Probably fast enough for most situations, but fast is
never a bad thing, is it?
Also, I'm trying out the other new "experimental" features as well, such
as… whatever that's called in English… code expansion? Text expansion? That
is, when I type I get suggestions. This only work with the new extended
data types.

I work with VBA in Excel at work (that's what they have so that's what I
must use), and I kind of miss that feature. In LibreOffice, it means that I
don't have to use xray as much as otherwise. Another minor thing I miss
from Excel VBA, is that I can see the value of a variable by just hovering
the mouse pointer over it. Excel has a lot of nasty bugs though, I don't
miss them… :P Not said that LibreOffice Calc is bugfree in any way, there
are some, there too.

Anyway, at the moment I'm only experimenting with it, just for fun, but it
would be nice to see some documentation of all this. If examples are
included – even better.

Kind regards

Johnny Rosenberg

Sent from BlueMail <>
On Nov 19, 2017, at 5:31 PM, Johnny Rosenberg <>

Oops, sorry. I did it again, I accidentally replied privately rather than
to the list. I'm sorry for that, Robert.

---------- Forwarded message ----------
From: Johnny Rosenberg <>
Date: 2017-11-19 23:19 GMT+01:00
Subject: Re: [libreoffice-users] Macro Dim Dialog and Control
To: Robert Großkopf <>

2017-11-19 20:00 GMT+01:00 Robert Großkopf <>:

 Hi Jonny,

 This works, but what about oDlg and oCtl? Are there special data types


 them too? The documentation I've found so far doesn't give any hints at
 all. I tried this:
 Dim Dlg As ' No error here,
 ' but next line throws an error:
 oDlg = CreateUnoDialog(DialogLibraries.Standard.MyDialogue)
 ' Error: No access to object.
 '        Invalid usage of the object.
 ' Well, something like that, it's actually in Swedish.

 What is the name of the dialog? Is ist called "MyDialogue"?.

No, I actually faked it for this mailing list. The real name is in Swedish,
so I figured it would be easier for you guys if I picked an English name
instead, just for this example. But the name isn't the problem anyway. My
question is if there is an ”extended data type” for dialogs and controls,
just like there is for sheets ( and cells ( I searched for and while and thought that could be it for dialogs, but as I said, I got that
error message. When I used Object, like you do below, everything worked for
me too, but my question wasn't about getting it working, it was if there is
such a data type. I'm not doing anything particular, I'm just trying to
learn this new stuff about those ”new data types”, that I enable by
selecting Tools → Options… → LibreOffice → Advanced → Activate experimental
features, then restart LibreOffice, then Tools → Options… → LibreOffice →
Basic IDE options → ☒ Use extended data types (give or take some words or
phrases, since this is a translation from Swedish).

When trying to get information I found this page:

However, they only provided two examples of those new data types (the two I
mention above), and there's no link or anything that points to the rest of
them, so it's pretty useless, unfortunately.

 It should
 appear at the left (catalog of objects - don't konwo if this is the
 right name ..) and at the bottom (like the standard "Module1")

 Declare the dialog first, out of a sub:

 Start the dialog:

 SUB Dialog0Start
 oDialog0 = createUnoDialog(DialogLibraries.Standard.Dialog0)

 Name of the dialog is "Dialog0"

 End the dialog:

 SUB Dialog0Ende

Yes, that's how I used to do it, and it usually work for me too, but this
wasn't what I asked about. My question is about those new data types,
mentioned on the page I referred to above.

I'm sorry for my confusing English, which obviously isn't my native
Thanks for replying, though! :)

Kind regards

Johnny Rosenberg


 LibreOffice Community:

 To unsubscribe e-mail to:
 Posting guidelines + more:
 List archive:
 All messages sent to this list will be publicly archived and cannot be

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
Privacy Policy:


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.