Hiding and protecting sheet without crashing Excel!

C

caroline

Hi,
I would like to hide a sheet and protect it at the same
time.
Excel crashes if I use the "hide" menu and then write the
following code in the Sub Workbook_Open():
With Worksheets("sheet1")
.EnableSelection = xlUnlockedCells
.Protect Contents:=True, Password:="xxx",
DrawingObjects:=True, UserInterfaceOnly:=True
End With

Any suggestion? Thanks
 
P

pikus

Set the worksheet's .Visible = 2

That will make the sheet "Very" hdden. It won't even show up on th
unhide menu.

Does that work for you? - Piku
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top