at least I see with VBA mode Basic the Set statement produces a runtime error. This is not exclusively a BASIC ( in vba mode ) problem but I found it while trying a vba test document and it is easy to reproduce that way
Created attachment 66914 [details]
open the document, press the button, you should get a message saying ok, what you will get is an Error message saying something about some internal error 51 or something.
Noel Power committed a patch related to this issue.
It has been pushed to "master":
fdo#54718 fix opcode detection in basic resulting in failed/unregcognized code
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.