password vba

N

Newbie

Hi,
Is there a way to password the vba modules in an excel worksheet so that
unauthorised people can't change it?

Thanks
 
P

Paul B

To protect the VBA project, from your workbook right-click the workbook's
icon and pick View Code. This icon is to the left of the "File" menu this
will open the VBA editor, in the left hand window right click on your
workbook name and select VBA project properties, protection, check lock
project for viewing and set a password. Press Alt and Q to close this window
and go back to your workbook and save and close the file
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **
 
I

Ian

In the VB Editor, select:

Tools>VBA Project Properties. Click on the Protection tab,
check the "Lock project for viewing" and enter a password
and click OK.
 
N

Newbie

Thanks- works a treat
Paul B said:
To protect the VBA project, from your workbook right-click the workbook's
icon and pick View Code. This icon is to the left of the "File" menu this
will open the VBA editor, in the left hand window right click on your
workbook name and select VBA project properties, protection, check lock
project for viewing and set a password. Press Alt and Q to close this window
and go back to your workbook and save and close the file
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **
 
B

Bob Phillips

Newbie,

Be aware though that is about as secure as a government secret!

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

You can't, either in a workbook or an addin, it's weak and that is just the
way it is.

The only secure work is to put the code in a DLL, but that is much more work
and involves distributing the DLL.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
N

Newbie

Thanks
Bob Phillips said:
You can't, either in a workbook or an addin, it's weak and that is just the
way it is.

The only secure work is to put the code in a DLL, but that is much more work
and involves distributing the DLL.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top