Right Click Sheet Tab

dannyr3065

New Member
Joined
Oct 30, 2019
Messages
9
Hi, how can I hide the 'right click' options on a Worksheet Tab (not the Worksheet Cells) pls... I have a Worksheet that I lock with VBA (password) and I dont want users to be able to unlock hte Sheet through the 'right click' option, eg: Insert / Delete / Rename, etc
 

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
There may be some API coding that could do that, but it's way beyond me!

I hide the tabs and force the user to navigate through buttons.
 
Last edited:

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
2,919
.
Paste this in the ThisWorkbook module :

Code:
Option Explicit


Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.CommandBars("Ply").Enabled = True
End Sub
 
Private Sub Workbook_Open()
    Application.CommandBars("Ply").Enabled = False
End Sub
 

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
That's neat, where did you find that?
 

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
It does work. Either close and re-open the workbook or enter Application.CommandBars("Ply").Enabled = False in the immediate window.
 

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
2,919
.
Yes, you must close the workbook, then re-open it for it to work.

Or .. I presume you could place it in a separate macro by itself and attached a command button to it. But then,
your users would be able re-enable the Rt Click menu again if you had command buttons.

I simply did a GOOGLE search. GOOGLE I am told is my friend ?
 

Forum statistics

Threads
1,081,574
Messages
5,359,707
Members
400,545
Latest member
Damntheman30

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top