Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Workbook level protection 1

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
On the close of my workbook, I want to enable workbook level protection in order to keep users from changing the names of my worksheet tabs if they open it with macros disabled.

I tried:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)

ActiveWorkbook.Protect ("MyPassword"), Structure:=True, Windows:=False

End Sub

but excel doesn't seem to recognize this command on this event. Does anyone know how to do this?

Q: Why is my computer doing that?
A: Random Perversity of Inanimate
Objects
 
Set all your worksheets (except a cover sheeet) to xlVeryHidden when closing the, and have a macro run to unhide the sheets on opening. If macros are disabled the sheets will not be available when the file is opened, and you can have a message to that effect on th ecover sheet.

A.C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top