Protecting complex VBA projects with VBASafe

 

VBASafe is a powerful scrambling tool for your VBA code and projects. If you have developed a complex VBA project then we suggest that you follow the methodology described below to avoid debugging issues.

 

1. Open your VBA project file (if your VBA project has an ".xla" extension then make sure to change this to ".xls" to apply the encryption process)

 

2. Make a note of the following variables that you might have defined:

 

-  Custom VBA functions which are used on worksheets

-  VBA variables which are enclosed in double quotes "" - e.g. variables used in procedures such as ".OnTime", ".OnAction" and ".OnKey"

-  VBA procedures and names of modules which are linked to command buttons residing in worksheets

 

 

3. Enter the names of these variables in the 'Exceptions' text file of VBASafe. You can access this by clicking on the corresponding command on the VBASafe menu.

 

ScreenHunter_01_Jul._02_14.56.jpg

 

 

4. Save and close the 'Exceptions' file. You are now ready to encrypt your project. Make sure the workbook with your VBA project is active on screen and choose the command 'Encrypt VBA Project..."

 

ScreenHunter_03_Jul._02_15.00.jpg

 

 

5. Click 'Yes' on the prompt screen that appear to begin the encryption process.

 

ScreenHunter_02_Jul._02_15.00.jpg

 

6. When the encryption process is completed, you will notice that your code has been scrambled. Compile your VBA project to ensure that no errors are present.

 

7. You will also notice the creation of a new file with the extension "name_list.tmp". This file contains a table with the scrambled variable names and the original names and can be used for debugging purposes.