Try this:
Sub Switch_Books()
Dim ws As Worksheet, wsName
protect_book True 'This is a confusing call...
' you should switch the way the boolean works
wsName = IIf(ActiveSheet.Name = "Console", "CDA Console", "Console")
ThisWorkbook.Sheets(wsName).Visible = xlSheetVisible 'must be at least one sheet visible
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> wsName Then ws.Visible = xlSheetHidden
Next ws
protect_book False
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…