M
Marc
I have protected sheet and workbook with password.
I have this code and is working ok. Does anyone have some suggestions to
this code, as I am beginner?
Private Sub Workbook_BeforeClose(cancel As Boolean)
Dim L As Long
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect (5)
Me.Worksheets(1).Visible = True
For L = 2 To Me.Worksheets.Count
Me.Worksheets(L).Visible = xlVeryHidden
Next
ActiveWorkbook.Protect Password:="5", Structure:=True, Windows:=False
ActiveWorkbook.Save
End Sub
similar is for Open
I have this code and is working ok. Does anyone have some suggestions to
this code, as I am beginner?
Private Sub Workbook_BeforeClose(cancel As Boolean)
Dim L As Long
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect (5)
Me.Worksheets(1).Visible = True
For L = 2 To Me.Worksheets.Count
Me.Worksheets(L).Visible = xlVeryHidden
Next
ActiveWorkbook.Protect Password:="5", Structure:=True, Windows:=False
ActiveWorkbook.Save
End Sub
similar is for Open