Click to See Complete Forum and Search --> : Protecting an Excel VB Module
Dimitri
Jan 13th, 2000, 01:47 AM
Greetings all
Is there a way for me to make the code in my modules (I am using Excel VB) invisible or hidden somehow? I am trying to find a way to not make the code visible for someone else to copy unless they have a password or key.
Thanks in advance to all
Dimitri
If you protect the whole workbook then no one will be able to access any sheet etc without the password. This way they cannot access your module/macro
Dimitri
Jan 13th, 2000, 02:14 AM
RICH539006 Thanks for your reply and suggestion. I have considered your approach but I am concerned that by protecting the sheet this way the user won't be able to manipulate the worksheet. I want the user to be able to change stuff on the worksheet and to do so use my functions and modules but to not be able to duplicate the code and use it for his or her advantage without my permission..
Again thanks for the reply...
Dimitri
ChrisJackson
Jan 13th, 2000, 07:06 AM
Hi Dimitri.
Here's how to do it.
In the Excel VBA Editor Window, select Tools...VBAProject Properties. Then Click on the Protection Tab. Put a check by Lock project for viewing and type in a password. Click OK.
Now your VB-Excel Code is password protected! In order to test if it worked, save and close the workbook, open it back and try to look at the Code.
All the best.
Chris J.
Dimitri
Jan 13th, 2000, 08:10 PM
ChrisJackson thanks for your reply....
I have done exactly what you said but for some reason it is not working. Anyone can still see the code. I have tried to open the file after saving it and the code is right there. I also tried from another computer with a totally different login and nothing happened. I wonder if it is a flaw.. what you recommended seems to be the solution but at lease for my Excel 97 SR2 it is not working.
Thanks for your reply
Dimitri
netSurfer
Jan 13th, 2000, 09:34 PM
One thing you could always try is to write a function to catch everything the user does. If they try to view your code, and you capture all the possible ways that they can do this, you can interupt it with a message saying they can't and then cancel the action.
ChrisJackson
Jan 13th, 2000, 09:47 PM
Hi Dmitri.
Be sure that you check "Lock Project for Viewing" when you create the Password. Try closing the VBA Editor Window after you Password protect it. In addition to saving the workbook, you have to CLOSE the workbook completely and re-open it again before the password takes effect.
It should work. I've never had a problem with this before.
All the best.
Chris
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.