Hiding VB Code

J

johnsail

How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and select
View, you can see all the code - including the password that is "protecting"
the sheet.

John
 
B

Bob Phillips

Password protect the VBA project, Tools>Project Properties>Protection

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
D

Don Guillett

At the top of the module put
Option private module
and they can't see it from tools>macros
Also, protect the macro project to deny access to most people.
 
J

johnsail

Hi Don

Don't understand what you mean here. Can you explain a bit further please.

John
 
G

Gord Dibben

When you set a password on VBAProject>Protection> "lock for viewing" you
must save and close the workbook.

When you re-open, the protection is functional.


Gord Dibben MS Excel MVP
 
D

Don Guillett

Pretty simple..type option private module as the top line in the module. Same as typing
private sub thissub() for each

Now goto tools>macros>macros and you will not see your macros anymore.
To work in the module comment out the line and then uncomment when through
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top