Microsoft Office 2000/Visual Basic Programmer's Guide   

Protecting Your Solution’s VBA Code

By default, the VBA code in a Word, Excel, FrontPage, Access, Outlook, or PowerPoint solution can be accessed by anyone who knows how to open the Visual Basic Editor. In the absence of any access security, any such user can open and alter your solution's code, potentially breaking it, or a malicious user or macro virus could add code that performs pranks or compromises the security of files and settings on a user's computer. There are four ways to control access to the VBA code in your solution:

This section discusses how to lock your solution's VBA project. For information about how to create COM add-ins, see Chapter 11, "Add-ins, Templates, Wizards, and Libraries." For more information about Access .mde and .ade files, see Chapter 18, "Securing Access Databases." For information about controlling access to files, see "Using File-System Access Control to Protect Access to Documents" earlier in this chapter.