If you have done much MicroStation VBA development at all you realize how easy it is for a casual or curious user to open the VBA Editor and possibly break your code. For internal company deployments you can modify the security on the .mvba files so that these users have read-only access. When distributing your VBA’s to clients or consultants you may not have that level of control. The VBA Editor allows for password protecting your .mvba files. By protecting your files with a password users are still able to run the macros but cannot view or edit the source code without entering the password.
To password protect your VBA macro:
- Select Tools > Default Properties from the VBA Editor top menu bar.
- In the Project Properties dialog click the Protection tab.
- Enter your password into the password fields at the bottom
- Click the OK button in the dialog to save the password
Note: This password protection offers only minimal protection for your VBA. There are many VBA password cracking tools available that will allow more sophisticated users to bypass this protection measure.