Question

Now that I know that there is an easy workaround to the standard way of locking and password-protecting VBA code, I'd like to move on to more effective ways of protecting code. I am to deliver an Excel-based tool to a client, but would like something more than simple annoyance-type protection that will only deter the laziest of hackers.

Are there any options in Excel-VBA, or do we really have to compile a separate application and forget about our Excel-based interface?

Was it helpful?

Solution

The easiest and most efficient way is to move your VBA code to a VB6 compiled Com/automation addin.

Or you may want to consider a .Net (with obfuscator) solution if performance is not important.

OTHER TIPS

Another Trick is to write the code against a excel object in Access then make the access file in to a .mde http://www.blog.methodsinexcel.co.uk/?s=Access+MDB Poor, but cheep ;-)

No need to convert to another language - you should be able to obfuscate most of your VBA code through www.vbsobfuscator.com [Note: Links to archive.org]

Practically, VBA obfuscators do not protect VBA code because they leave the structure of the algorithm unchanged, which can be traced back to the original algorithms which can then be recovered.

Converting your VBA code to VB6 means your application will be limited to 32bit Excel (VB6 doesn’t have a 64-bit version) and it can be decompiled by VB decompilers such as https://www.vb-decompiler.org/

Converting your VBA code to VB.NET isn't a perfect solution either, as .NET has a ‘reflection’ mechanism which can convert the compiled code of .NET assembly into the original source code.

You can convert your VBA code to C/C++, which would be a very effective form of protection, but since C/C++ and VBA are very different programming languages, the conversion of VBA code to C/C++ is difficult, error prone, and generally not worth the huge amount of time and effort that it takes.

There is a tool called VbaCompiler for Excel (http://vbacompiler.com) which converts the VBA code to C language code and then compiles it into a DLL. The level of protection this tool claims to provide is similar to that of converting your VBA code to C/C++ but without the massive amount of manual work that is required for such a process.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top