View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JulieF JulieF is offline
external usenet poster
 
Posts: 6
Default Macro to open view with a password

I am trying to have a macro open a view on a worksheet and really want to
have the worksheet protected. If i set a worksheet password the user is
prompted for it when they click on the macro button, is there any way i can
inlcude the password in the macro? I would also like to protect the
worksheet once the macro has been run.

The macro is as follows.

ActiveSheet.Unprotect
ActiveWorkbook.CustomViews("2 - Monday View").Show
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowSorting:=True
Range("L9").Select
End Sub