When trying to run the very simple script:
Dim Dialog1 as object
Sub Dialog1Show
BasicLibraries.LoadLibrary("Tools")
oDialog1 = LoadDialog("Standard", "Dialog1", DialogLibraries)
oTextField = oDialog1.getControl("dte") 'Textbox to display date'
oTextField.settext Format (Date,"mm/dd")
oDialog1.Execute()
End Sub
I got an error at the LoadDialog
function.
Function LoadDialog(Libname as String, DialogName as String, Optional oLibContainer)
Dim oLib as Object
Dim oLibDialog as Object
Dim oRuntimeDialog as Object
If IsMissing(oLibContainer ) then
oLibContainer = DialogLibraries
End If
oLibContainer.LoadLibrary(LibName)
oLib = oLibContainer.GetByName(Libname)
oLibDialog = oLib.GetByName(DialogName)
oRuntimeDialog = CreateUnoDialog(oLibDialog)
LoadDialog() = oRuntimeDialog
End Function
When the function gets to the line oLibDialog = oLib.GetByName(DialogName)
I get an error:
BASIC runtime error. An exception
occurred Type:
com.sun.star.container.NoSuchElementException
Message: .
But I cannot figure out why. The same script seems to be working for many people so I am at lost here… My libreoffice is running under Ubuntu 16.04
Any help will be appreciated.
Thanks.