Bug 69307 - BASIC: No way to interrupt a running macro
Summary: BASIC: No way to interrupt a running macro
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: BSA
Depends on:
Reported: 2013-09-13 08:56 UTC by zgh47mk184
Modified: 2013-09-15 09:06 UTC (History)
0 users

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description zgh47mk184 2013-09-13 08:56:16 UTC
Problem description: 

Could not interrupt a running macro

Steps to reproduce:
1. write simple macro such as

sub no_way_to_interrupt_me
    for i = 1 to 1000
        msgbox "hello"
end sub

2. Press F5 to run macro

3. Try to interrupt it, keys like break, Ctrl x, or the F-keys did not work to stop the macro

Current behavior:
  macro runs until the loop ends

Expected behavior:
  keys like Ctrl + break or esc should stop the macro

Operating System: All
Version: release
Comment 1 Mike Kaganski 2013-09-15 09:06:27 UTC
Well, actually there is a way to stop running macro. In my system, with default settings, the corresponding combination is Shift+Ctrl+Q.

To test, you may create a macro with this:

while true

and run it. It will run in background, but if you look into IDE, you will see that it runs. If you use the combination, a dialog pops up saying that macro has been stopped.

Your case is an edge case. The msgbox routine creates a modal dialog that intercepts all input and has no special processing of hotkeys. So, whatever you press while the message box is up, it will not reach LO. When you close the message box, another one pops up immediately, giving you no time to use the hotkeys. If you have no other LO windows open at the moment, you will have to close all the boxes. But I doubt that this is a real-life issue. If you develop the macro, and have IDE open, you may use its controls to stop the macro. Other LO windows are not blocked by the message boxes, so the hotkey will stop it.

I close it as NOTABUG. But if you feel that it is incorrect, please reopen it. Don't forget to describe your point. You may, for instance, want to make this an enhancement request to enable the modal dialog boxes to process the macro-terminating hotkeys.