PDA

View Full Version : Solved: Lock VBAcode



cro_dux
02-22-2007, 03:50 PM
Hi,
is there a way of protecting macro code so that my client can't mess up the code. I have a word document with a macro and I will give him to use that document (macro is doing searching and c/p) but I want to stop him from looking at the code.
It doesn't have to be very good protection, just something that would stop basic computer user.
tnx

lucas
02-22-2007, 04:25 PM
Anyone with the desire can break your code....if you want minimal protection...you can password protect your code.

In the vbe...look in the project explorer on the left for your project..by document name...right click on it and select "Project Properties"

Select the protection tab and click the box that says "Lock project for viewing" then select a password and click on ok...that's it.

This will keep most prying eyes from seeing you code and is adequate unless it's really important, in which case you need to build your project in visual basic, etc. where there is more security.

cro_dux
02-23-2007, 03:53 AM
tnx for help.
I didn't write but I would like to preserve code from viewing it (I don't want client to see VBA code). Is that possible ??

lucas
02-23-2007, 06:33 AM
If you had followed the tip in post #2 you would know that they cannot see the code without the password. It can be broken however but it does keep average users from seeing the code.......

cro_dux
02-23-2007, 08:33 AM
I followed your procedure but I forgot that my macro is in all word documents. When I put it only in my project and locked like you wrote nobody can see it.
Thank you

lucas
02-23-2007, 09:04 AM
Your welcome.....be sure to mark your thread solved using the thread tools at the top of the page.