Yet another silly OpenOffice.org Basic-related question from yours truly. I have two macros in the same module, where Macro1 displays a dialog box. The Macro2 must close the dialog box from Macro1 before it does certain actions. The way I try to solve the problem is to make the Dialog a public variable and then use the Dialog.Dispose command in Macro2. The problem is that it doesn't work: every time I run Macro2, it crashes OpenOffice.org. Here is the code:
Code: Select all
Public MyDialog
Sub Macro2()
MyDialog.Dispose
MsgBox "Hello world!"
End Sub
Sub Macro1()
exitOK=com.sun.star.ui.dialogs.ExecutableDialogResults.OK
DialogLibraries.LoadLibrary("Standard")
Library=DialogLibraries.GetByName("Standard")
TheDialog=Library.GetByName("Dialog1")
MyDialog=CreateUnoDialog(TheDialog)
MyDialog.Execute
End Sub
Thank you!
Kind regards,
Dmitri