I would like to hide the shortcut menu for the worksheet tabs when I
open a specific workbook.
I used the following codes in each worksheet.
Private Sub Worksheet_Activate()
On Error Resume Next
CommandBars("ply").Enabled = False
On Error GoTo 0
End Sub
Private Sub Worksheet_Deactivate()
On Error Resume Next
CommandBars("ply").Enabled = True
On Error GoTo 0
End Sub
It works, but If I opened a new workbook the shortcut menu for the
worksheet tabs is still hidden.
I tried the following code, but the problem is the same.
Private Sub Workbook_Activate()
On Error Resume Next
CommandBars("ply").Enabled = False
On Error GoTo 0
End Sub
Private Sub Workbook_Close()
CommandBars("ply").Enabled = True
End Sub
Please could you help me to solve this problem?