Right Click Sheet Tab

dannyr3065

New Member
Joined
Oct 30, 2019
Messages
11
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
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

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
3,353
.
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
3,353
.
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 ?
 

Watch MrExcel Video

Forum statistics

Threads
1,102,872
Messages
5,489,403
Members
407,687
Latest member
NeoSez

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top