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

Maya - Oct 12, 2015 at 06:00 AM
 Maya - Oct 14, 2015 at 08:08 AM

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 responses

vcoolio Posts 1409 Registration date Thursday July 24, 2014 Status Moderator Last seen May 23, 2024 262
Oct 14, 2015 at 07:06 AM
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.

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Oct 12, 2015 at 03:26 PM
one way would to use events

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
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.
Thanks. That works windows only. code is not supported in Mac