Hello,
The problem is being created by a Function. It has nothing to do with protected code. Have seen this in both Basic and Python code. Certain items don’t seem to complete until an entire process is finished when a Function is used within the code. This occurs in your code when you call Install_HSQLDB
which calls the function isInstalled()
.
Also use this to load your library:
If Not BasicLibraries.isLibraryLoaded("sm12") then
ThisComponent.BasicLibraries.loadLibrary("sm12")
Endif
So here is how I got all to work. Created small macro only to load libraries and attached to Open Document
event of Base. Moved the Setup
code to the protected sm12
module for testing. Attached this to the View Created
event of Base. Saved Base. Opened Base and all worked.
So two events were fired off when Base was opened. Document opened and library loaded; View created and protected code was executed.
Again, this has nothing to do with protected code. The same holds true if not set with password.