Password visible if user selects "view code"

K

kcdonaldson

I recently added a command button to a worksheet to validate a timestamp. my
document is password protected but if the user selects edit from the control
toolbar and then right clicks and selects view code, they are able to see the
password. Is there anyway i can edit this so that they will not be able to do
this?
 
G

Gord Dibben

You must protect the VBA Project, not just the document.

With your workbook open hit ALT + F11 to go to VBEditor.

Select you workbook/project and right-click>VBA Project Properties

Click Protection tab and "locke project for viewing".

Enter a password.

You must now save and close the workbook.

When you re-open "View Code" will bring up a password dialg box.


Gord Dibben Excel MVP
 
C

Chris Lavender

Open VB Editor (ALT+F11), right-click the VBA project title in the project
window > Properties > Protection. Check the 'Lock project for viewing'
box and add a password. Save project

HTH Best rgds
Chris Lav
 
Top