Disable right click on sheet tabs in excel (MAC) using VBA code

Closed
Report
-
 Maya -
Hello,

I am looking for a VBA code to disable right click on worksheet tabs in MAC excel.
Application.commandbars("Ply").enabled=false is not working in MAC. Thanks in advance for your answer.

3 replies

Posts
1328
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
January 10, 2022
241
Hello Maya,

You could try the Workbook_Open event:-

Private Sub Workbook_Open()
      Application.CommandBars("Ply").Enabled = False    'Hides SheetTab Menu
End Sub


Right click on your main tab, select "view code", in the Project Explorer side bar select "This WorkBook" and in the big white field, paste the above code.

It may work.

Cheerio,
vcoolio.
1
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
one way would to use events

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
0
Thanks rizvisa1.The code you mentioned works only for cells( right click). It won't work for sheet tabs(right click). I want to disable right click on sheet tabs in MAC.
0
Thanks. That works windows only. code is not supported in Mac
0