Hi, coreytroy,
you may use xlSheetVeryHidden which is only available from the VBE, and I won´t rely on Application.Username but take the name of the system instead:
Private Sub Workbook_Open()
Select Case LCase(Environ("username"))
Case "yyz", "hahobe"
Sheet8.Visible = True
Case Else
Sheet8.Visible = xlSheetVeryHidden
End Select
End Sub
And I try to avoid the Worksheet_Deactivate-Event and use the Worksheet_Activate instead:
Private Sub Worksheet_Activate()
' Keep Sheet8 Hiden unless approved to view
If Not Application.UserName = "me" Or Not Application.UserName = "user2" Then
Sheet8.Visible = False
MsgBox "YOU are not permitted to view sheet8 !", vbExclamation, "Warning !!!"
Exit Sub
End If
End Sub
Ciao,
Holger
Bookmarks