The window cannot be closed while BASIC is running

I wrote a macro (while RowSet.Next()…wend)
to run a select query, assigned it to a textbox control event (keypress)
now the macro doesn’t end,
above eror message appears while trying to close.
I am in transition period to libreoffice from MSOffice.
Using Libre 4.2.4.2
OS Ubuntu 12.04

So, why does RowSet.Next() never return false? Is the rest of your code top secret?

Rest of the code is "MsgBox “Item: " + RowSet.getstring(1) + " " +Rowset.getstring(2)”
Point is I can’t close, exit libre office or delete the macro completely. It’s stuck.

If you can, print out or write down by hand your macro and then pull the plug. Simply switch off the power.