View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Option Private Module (for Object Modules)

The only way to prevent a user from going into "design" mode, or simply
opening the VBE with alt-F11 and looking at your project, is to lock the
project with a password.

Rt-click the project, Project properties, Protection, check the lock
checkbox and add the password.

VBE project passwords are much more secure than say worksheet/workbook
passwords, but that's a relative term, relatively easy to hack.

Procedures in Object modules (Sheet & Thisworkbook) will not be seen in
Macros (Alt-F8) or the function wizard (shift-F3).

Regards,
Peter T


"WCM" wrote in message
...
Hi Friends,

In my Excel Project, I have hidden all VBA code modules by inserting
'Option
Private Module' in the General Declarations section; I have also password
protected the VBA project.

Question:
I have a command button on one worksheet - the button has VBA code behind
it
(simple code that calls a sub proc from a code module).

I would like to hide the code behind the button, but there seems to be no
way to hide code that is in an Object Module (as opposed to a standard
Code
Module).

Any way to hide code that is behind a command button so user cannot go
into
VB design mode and see that code behind the button? Note: Assume that
protecting the worksheet is not an option.

Thanks in advance ...

Bill