Apache OpenOffice (AOO) Bugzilla – Issue 96200
Unable to Edit Macros with Error in Base Form
Last modified: 2013-02-24 21:00:38 UTC
I added a subroutine called Init to a form in base. I assigned this subroutine to the When Loading event of the form. The subroutine has an error in it, and I now cannot edit the macros for the form to fix it. Even when opening the form as Edit from the context menu, the subroutine is executed and stops on the error. The form and basic editor both show being a read-only status. I now have to delete the form and recreate if from scratch if I want it to work. I will attach the database showing this problem. I think the fix should be to allow the editing of scripts with errors whenever the form or document is open for editing.
Created attachment 57988 [details] A small database I was using for practice.
Found a workaround simpler than recreating the form: I removed this database from a Trusted Sources directory and opened it with macros disabled. This allowed me to edit the macro and fix the error (missing globalscope. before basiclibraries). However, I still think this is a problem that deserves some attention.
Frank, please have a look ...
Cannot reproduce. I used your database, and added the "Init" method to the "Open Document" in "Tools / Options / Customize / Events". Now, opening the form for editing ("Edit" in its context menu) opens it, then opens the Basic IDE, jumps to the Init method, and displays the error. Both the Basic IDE and the form are perfectly writable.
Created attachment 57992 [details] modified version of the first document, with the "Init" method already assigned to the "Open Document" event
I'll look at your modified version to see what happens on my system, but I was seeing this with the event in the When Loading of the "Gems" forms. I don't think I made that as clear as I might have. It looks like When Loading runs even when editing a form, and I'm not sure that is desirable behavior.
Please test it in our latest version 3.2.1 there you can save Macros also in the *.odb files