View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Metallo[_4_] Metallo[_4_] is offline
external usenet poster
 
Posts: 21
Default Can anybody help please? Urgent

Marcotte,

Thanks for your comments.

But my problem is to add somehting to an existing code.

For instance, is there a way to put a password to this Workbook Open, it is
already protected but without password, I want to add a password valid for
all the sheets.
Also, can you tell me the meaning of True (4 times in a row)?

Thanks for any help
Alex

Private Sub Workbook_Open()

'''Enable Outlining navigation and protect everything on

the sheet with
UserInterfaceOnly.

Sheet1.EnableOutlining = True
Sheet1.Protect , True, True, True, True
Sheet2.EnableOutlining = True
Sheet2.Protect , True, True, True, True
Sheet3.EnableOutlining = True
Sheet3.Protect , True, True, True, True
Sheet4.EnableOutlining = True
Sheet4.Protect , True, True, True, True
Sheet5.EnableOutlining = True
Sheet5.Protect , True, True, True, True
Sheet6.EnableOutlining = True
Sheet6.Protect , True, True, True, True
Sheet7.EnableOutlining = True
Sheet7.Protect , True, True, True, True
Sheet9.EnableOutlining = True
Sheet9.Protect , True, True, True, True
Sheet10.EnableOutlining = True
Sheet10.Protect , True, True, True, True
Sheet11.EnableOutlining = True
Sheet11.Protect , True, True, True, True
Sheet12.EnableOutlining = True
Sheet12.Protect , True, True, True, True
Sheet13.EnableOutlining = True
Sheet13.Protect , True, True, True, True
Sheet19.EnableOutlining = True
Sheet19.Protect , True, True, True, True

End Sub


"Marcotte A" wrote in message
...
You want to put the .Unprotect code at the beginning of your macro (either

first line or immedietly after the dim statements - but before any code that
makes changes). And you want to put the .Protect code at the very end of
your macro.

Basically, each line of code is interpreted in order (with exceptions for

if - then, loops etc.) If you have code that makes changes to a sheet with
protection, it will fail. So you need a line of code that will turn
protection off before the code that makes the changes gets executed. The
easiest way to do this is put it at the very beginning.