I have an Excel macro that I programmed in Visual Basic. I would like to keep it so people that have the macro can't go digging around in my code. Does anyone know how to put this sort of password protection on? Thanks.
Yes, you can lock the macro to stop other people from viewing its contents. To do this, go into the Visual Basic editor, go into the Project Explorer right-click on VBA-Project. Go into VBAProject properties. The second Tab up the top gives you the ability to lock the Project and set a password. So if someone tries to open up your project in VBE, they are required to supply the password.
There's always a way. Program called Advanced Excel Recovery will probably be able to crack it nomatter what. A very determined person will be able to crack most passwords.
To be honest not really. I doubt anyone would go to the trouble of doing this - it took me a while to find a decent one that worked (about a day though).
Hmmm. I suppose you could just split your code into lots of seperate subroutines. I think about it myself but, to be honest, few will bother pinching the code. I don't know much about dll's but I suppose you code use a visual c compiler, write a load of your code in c++ and compile it as a dll. Then use the vba to call the dll and do it that way. You could probably password both so even if they unlock the vba they'd then have to uncompile the c code and decrypt that as well (using different program). As I said I know jack about c++ or dll's so maybe worth asking others about.
If anyone else has any suggestions I'd be interested though.
I agree with MightyGinger. There is little you can do to stop a determined person from breaking into your code. I once had to unlock some old code for which I had forgotten the password, and it only took a few hours to find a program which was able to unlock it for me.
I'm sure there are other methods which might slow them down, but in the end i don't think vba is very secure.
I protected a rather volumineous macro with a password, but it did not work. After changing input and saving it again I got a message that the file was saved with a temporary name. The original file has disapeared and the temporary one could not be opened. Is there a max. size of the file that should be protected?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.