Hi,
There's nothing built into Office which allows you to compile your workbook into a COM add-in. Let's look at a couple of the options which are available to you. I'm not going to go into great depth on each option (one could write a book doing so) but hopefully this will give you a starting point to do your own research.
Since your code does not contain any UDFs, you could use VSTO. VSTO is written in .Net (VB.Net/C#). VSTO is quite complicated, can be problematic to deploy, and it's important to understand that .Net code isn't secure either - freely available tools such as Redgate's .NET reflector can be used to disassemble code. You could use an obfuscator but you're adding a whole load of complication and learning which you're trying to avoid.
VB6 is syntatically identical to VBA (so not much of a learning curve for you) and can be used to write compiled code (dll/exe). It's also secure. The problem with VB6 is it is legacy (it has been superceded by VB.Net) and is no longer supported by MS. You also might have trouble getting hold of the Visual Studio 6 software you need to do this (it is available with an MSDN subsription).
3rd Party Tools. There are some 3rd party tools which claim to be able to compile VBA code. I've never used one so I can't make a recommendation and I don't know how much you'll have to pay.
VBA. Unless you have written something truly incredible, my honest recommendation is just to stick with your VBA. 99.99% of users do not know how to break the VBA project password, so it will stop them from meddling with your code. This is what I do.
|