Password protect your Macros
You can prevent users from viewing your code by locking any VBA project associated with your MS-Office solution.
To protect your Excel VBA project press ALT+F11 or click 'Visual Basic' in Developer tab to open the VBA editor (VBE)
|
Password Cracking
Unfortunately, there are plenty of fairly inexpensive software tools that could recover a lost or forgotten VBE password, no matter its length or complexity, within seconds. So Excel's default VBE protection could be defeated easily. However, it is a good way to keep honest people from viewing or accidentally changing your VBA code.
|
A Costly & Complex approach
Most Excel experts tend to agree that VBA project
protection is weak and recommend to rebuild your VBA project in VB6,
VB.NET, C#.NET, VSTO, C++ or Delphi. There are several disadvantages with this approach:
- A steep learning curve is required to adopt a new technology, even for experienced Excel/VBA developers.
- The developer may have to purchase new licenses for the language of preference and related software utilities.
- Not all native Excel objects may be available within the compiler libraries used.
- An installer would be required to distribute the executable files, where Excel files can just copied to any folder.
- Two separate installations may be required (for 32 and 64 bit), where a single VBA project can be run in both environments, due to conditional compilation. Please read our article on 32/64 bit Office compatibility.
- Additional effort and costs may be required to defend .NET executable files against hacking: .NET obfuscation against decompilation. For example, Reflector is a class browser and analysis tool for .NET, that allows developers to navigate, search, disassemble and analyze .NET components !
Cost-effective Techniques
|
Obfuscation just hides the intent of your Excel VBA program without changing its runtime behavior. Your obfuscated program will run in any Excel version and in both 32/64 bit Office versions, if your original code does so. No external ActiveX libraries are used.
Please read about our VBA Obfuscation or contact us for more information
Please read about our VBA Obfuscation or contact us for more information