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

Closed
Maya - 12 Oct 2015 à 06:00
 Maya - 14 Oct 2015 à 08:08
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 responses

vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Contributor Last seen 6 September 2024 262
14 Oct 2015 à 07:06
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.
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
12 Oct 2015 à 15:26
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