Terminating LO leaves Macro Window open

Win10, LO 6.7.4 HSQL2.5

Hello again,

Normally using forms I have no problems quiting the db with varous subs, however when I want to
terminate from a messagebox option LO closes but opens a blank macro window. Can this somehow be
prevented?

Attached link to mockup db

Thks

Hello,

Do not believe this can be done as you want. This works when executed alone:

ThisDatabaseDocument.Close(True)

and this (corrected) by itself:

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Quit", "", 0, Array())

but not with all the calls and message boxes.

BTW this is not correct:

…LO closes but opens a blank macro window.

Actually LO has crashed & that is a recovery window. It is empty as there is nothing to recover.

You can always create you own menus and enable/disable items.

@Ratslinger thanks, that basically means the message box needs a form, hmmm, will try another way.