0

I have been trying to do this myself, but I just dont know how to define the problem. I have been writing a Macro for LibreOffice and it includes several dialogs. When I Run the macro I want to execute a Function after the dialog is visiable. I could not find the solution to this so I made another dialog which only shows "Loading, Wait..." and I inserted at the beggining and end of that function, dialog.Execute() and dialog.endExecute(). I guess the program stops at .execute() and im stuck at "Loading, Wait..." sign if I press "X" in the corner the program continues normally.

Best solution would be if I could run a function after the dialog is visible. So is there sort of a trigger ?

Uroš Grum
  • 138
  • 2
  • 14

1 Answers1

0

You can load the dialog and make it visible, but this would not activate the functions (buttons etc.), as this is what execute does

' StarBasic
' Tools
With GlobalScope.BasicLibraries
   If ( Not .isLibraryLoaded("Tools") ) Then
     .LoadLibrary( "Tools" )
   End If
End With 

sampleDialog = LoadDialog( "Standard", "Dialog1")

sampleDialog.setVisible(TRUE) 

Does this help you?

ngulam
  • 995
  • 1
  • 6
  • 11
  • I tought about it but it still doesn't do what I need it to do, I would need to execute a specific function that i have written, as soon as the dialog pop's up. Like in excel ther is a OnExecute() Function that runs as soon as the program starts. – Uroš Grum Dec 28 '15 at 11:22
  • I am not aware of such a function, i think you have to rebuild it, using `setVisible` (as shown above), then run whatever you need, finally `execute` dialog – ngulam Dec 28 '15 at 13:38
  • I figured it out! ... I forgot to think aoutside of the box ;) I changed the dialog so all was disabled and in huge red letters wrote "LOADING" after the function ran i enabled everything and changed loading to ready, ran execute and that's it :) Thank you ! – Uroš Grum Dec 28 '15 at 13:56