Protect Excel VBA code and lock VBA project, Unviewable VBA
By default, Microsoft Excel offers VBA password protection as a way to protect VBA code. This method of VBA code protection is weak and can be easily cracked. The DoneEx XCell Compiler provides a much better and much stronger solution to protect your VBA code from being stolen.
You can apply strong VBA code protection to the Excel workbook macros by following these easy steps:
1. Open the XCell Compiler compilation form by clicking on the “Compile” item in the DoneEx Excel ribbon menu.
2. Enable the Protect VBA code option.
This should cause the “VBA Protection Options” menu to pop up.
3. Enable “Obfuscation” and “Literal Removing” options in the “VBA Protection Options” window and then click the “OK” button.
You can also just enable the “Unviewable VBA code” option to select both the “Obfuscation” and the “Literal Removing” options at the same time.
4. Compile your workbook by clicking on the “Compile” button on XCell Compiler compilation form.
Once compilation is successful, you should see this window:
Now your VBA macros and your Excel formulas have the best possible protection thanks to DoneEx XCell Compiler!
How Macro Code Protection Works
To provide the strongest and most reliable VBA code copy protection, DoneEx XCell Compiler uses 2 different approaches which are combined into one solution when you select all of the options of “VBA Protection”.
Unviewable VBA project and VBA source code.
The “Unviewable VBA project” option locks access to the VBA macros, makes the VBA project unviewable, and disables VBA debug mode.
After applying this option, the VBA project and macros will be unviewable and unavailable in the protected workbook.
Anybody who tries to see your VBA Project or Visual Basic code will only see this message.
Any attempt to trace your macro code will fail due to a disabled VBA debug mode.
VBA source code modification.
Two options—the “Code obfuscation” option and the “Literals removing” option—modify the Visual Basic code in a way that keeps the code functional but makes it scrambled and incomprehensible.
After applying the “Literals removing” option, the modified Visual Basic macros become tied to the XCell Compiler run-time library and will only be functional in the protected workbook.
After applying all 3 options together, you will get the strongest VBA source code protection available! This has the following advantages:
- The VBA code is unviewable and inaccessible from the Excel VBA project.
- A disabled VBA debug mode, so it is impossible to trace the Visual Basic code.
- All comments and empty lines are removed from the macros.
- The macros with removed literals will not work outside of the protected spreadsheet.
- The VBA source code becomes modified to make it incomprehensible and unrecoverable.
Below you can see an example of Visual Basic code transformation after applying both of the code modification options.
The original VBA source code before applying ‘Protect VBA code’ option in XCell Compiler:
After applying both code modification options—the ‘Code obfuscation’ option and the ‘Literals removing’ option—the protect Excel VBA code transforms into the code displayed in this screenshot:
If you consider the VBA protection approach based on obfuscation to not be secure enough, then you need to take a look at DoneEx VbaCompiler for Excel. It which provides the absolute, bulletproof Excel VBA protection of your VBA code in workbooks as well as Excel Add-Ins. The VBA Compiler transforms Excel VBA code into a native Windows DLL and offers features such as VBA code copy protection using a registration/activation key.