MrExcel Publishing
Your One Stop for Excel Tips & Solutions

how do I protect a macro in excel?


Posted by Kathy on June 29, 1999 7:52 PM

Can anyone tell me how I can protect my VB macro's in
Excel so that they can't be viewed or changed?


Posted by Ivan Moala on July 06, 1999 5:48 AM

Kathy try the following
In VBA editor
Click Tools
Select VBA ProjectProperties
Click Protection Tab
Click <option button> "Lock project for viewing"
Click inside "Password" entry box and enter password
Tab to or click inside "Confirm password" entry box
If the two entries match you have locked you VBAProject
BUT.....Don't forget it!!!

Posted by Don Guillett on August 09, 1999 1:30 PM


I saw the answer above and agree. I have a similar problem in that I want to protect macros in both xl95 and xl97. in xl95, I used visible.xlveryhidden, protected sheet & workbook. But, in xl97, macros may be viewed and edited. If i use suggestion above, it works for xl97 but cannot be saved back to xl95. I need code that will work both in xl95 and in xl97 from xl95 wb.
donaldb@281.com

Posted by Ivan Moala on August 30, 1999 2:00 AM

For a work around have a look at the following article.

http://support.microsoft.com/support/kb/articles/Q167/9/09.ASP


regards


Ivan Moala