How can I quit form infinite error messages in basic

I try to write basic codes to help my work. Sometimes I make mistakes, that ignites an error messages - it happens frequently.
Now I write code, that gets all mouseclick, and makes the needed changes on the cells. But when I make syntax error, an error message comes up, and when I click OK, another message comes up immediately, and so on. I get in an infinite loop, and I cant get out from it but kill Libreoffice in task manager.
It’s very annoying, I don’t think, that no one make mistakes but me. What is the key that terminate macro with pops up error messages?

Hello szocsmarci,

have you tried Ctrl+Shift+Q ? Have a look into Tools -> Customize -Tab: Keyboard to find key codes

Thank you for your answer, but it didn’t solve my problem. The macro is already stopped and a popup window inform about the error. The problem is, that whenever I click OK, another popup window show up, and after that another - that’s going on forever.
image description

Ok - but this “answer” doesn’t solve your question as well. So please use “add comment” function, if commenting an answer.

I don’t understand Hungarian and also not how a stopped macro could issue an error message popup. How do you determine the macro is stopped? Is there any loop in your macro?

That was my first question, I’m not get used to this forum yet, sorry.
So, the meaning of error is not important, it’s only a crucial error, makes the program stopped in macro (basic) editor mode.In my case the editor is opening when the file is opened. I click OK, but another windows pops up over and over again. I guess it goes through all the cells, and after some million OK button it would get in normal position, I should work in the editor to correct my code.This occured me once before, when I made a custom function and I used in many cells. When I made mistake, as many window popped up as many custom function was used in the cells in the active sheet.
I guess it must be a rare bug, hardly find any such question except this:
https://bz.apache.org/ooo/show_bug.cgi?id=70598
In this post a definite msgbox iteration stopped form being quit - in my case an error box prevent the stop.

Oh - does your comment mean that your macro is implementing a new function, which is used in a large number of cells like =MYFUNCTION(<Range>;<OtherOpt>;...)? If that’s correct, then from my point of view there is absolutely no way of interrupting that, because your function is called as many time as it is used in a cell (and not only once). Therefore, if you use it in e.g. 1000 cells, you will get the popup 1000 times. The only way I see to prevent from this: Do not use an untested new function more than once (i.e. in one cell only).

Remark: I’m not sure about the effect of setting Tools -> Options -> LibreOffice Calc -> Formula and category Recalculation on File Load to Never recalculate

To the Remark: the Recalculation on File Load on already in Never recalculate setting.
I cant believe nobody has the same problem as me. This behavior of editor prevent to work with it. Impossible to write code with some wrong character in it.

Hmm - what to say. You don’t refer to my “Oh …” comment. Is that the case, that you create a new function and use it in a large number of cells? If that’s the case, please explain me (and any software developer) how he should be able to prevent from an error, which is executed ever and ever again. As stated: The faulty macro is being started more than once. And in that case(!!!) it has absolutely nothing to do with any IDE or macro editor.

Thanks for your reply, I see now, that we talk abut the same thing - but you see it as a necessary thing while I see not.
The problem is, when it connected to many cell, or an event triggered by a mouse action. In my case in last year I suffered from a function. This time I want to use a mouse click event. For this it would be a solution to limit action to a small cell area and after been tested extend to the whole page.But after this no one guarantee there will be no problem in different sheets or with different macros or with other machine.
I like Libre Office because of its portability, and because there is only one Libre Office (no 2007, 2013, 2016 versions). I bougth the official MS Office 2019 home verison (not for $10) but I don’t use it only for compatibility reasons. I would like to stick LO afterward but its hard to live without some basic.

If I would be a developer and wanted to prevent unlimited popup messages in LO basic editor I would make a button on the main window to prevent this. In this mouse action stuff I cant jump to the mains windows sheet. In the case of a wrong function I guess it wouldn’t work.
Second solution limit the number of error windows about ten.
I don’t remember that I stucked in in MS Excel(in my workplace I used MS Excel). Maybe there can be only one error and after that the macro stops. And the cell using wrong functions get error messages.