The file has worked properly for nearly a year now but suddenly has given the run time error message and allows other users to bypass the username/passcode section. When I cliecked onthe debug button, it highlighted the Sub VisibleFalse section on line ws.Visible = xlVeryHidden - I do not know how to fix this error.
I copied/pasted the entire string of code
Sub Showme()
frmLogin.Show
End Sub
Sub Toggle()
ActiveWindow.DisplayWorkbookTabs = Not ActiveWindow.DisplayWorkbookTabs
End Sub
Sub GetSheets()
'add the sheet names to the sheet
Sheet2.Range("Q8:Q108").ClearContents
Dim i As Integer
For i = 1 To Sheets.Count
Sheet2.Range("Q" & i + 7) = Sheets(i).Name
Next i
End Sub
Sub VisibleTrue()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.Visible = True
Next ws
ActiveWindow.DisplayWorkbookTabs = True
Sheet1.Select
End Sub
Sub VisibleFalse()
Dim ws As Worksheet
GetSheets
'loop through each sheet
For Each ws In Worksheets
'use the case statement to exclude sheets by sheet name
Select Case ws.Name
'add the name of the sheets to exclude
Case "Interface"
'Case "Login"
'protect the rest
Case Else
ws.Visible = xlVeryHidden
End Select
Next ws
End Sub
Bookmarks