ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide menu items (https://www.excelbanter.com/excel-programming/422368-hide-menu-items.html)

Cresta

Hide menu items
 
Hello

Could some one point me in the right direction please.

By right clicking on a sheet tab a context menu pops up, I need to hide this
menu so it is not available for a particular file for ceratain uses. I'm
guessing I would us XXX_getVisible callback, but I dont know how to reference
the menu.

Thanks


Mike H

Hide menu items
 
Hi,

You can use the worksheet event before right click.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If Environ("Username") < "USER" Then
Cancel = True
End If
End Sub

Mike

"Cresta" wrote:

Hello

Could some one point me in the right direction please.

By right clicking on a sheet tab a context menu pops up, I need to hide this
menu so it is not available for a particular file for ceratain uses. I'm
guessing I would us XXX_getVisible callback, but I dont know how to reference
the menu.

Thanks


Mike H

Hide menu items
 
Apologies I misread your post this disbale right click on worksheet not the
sheet tab.

Mike

"Mike H" wrote:

Hi,

You can use the worksheet event before right click.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If Environ("Username") < "USER" Then
Cancel = True
End If
End Sub

Mike

"Cresta" wrote:

Hello

Could some one point me in the right direction please.

By right clicking on a sheet tab a context menu pops up, I need to hide this
menu so it is not available for a particular file for ceratain uses. I'm
guessing I would us XXX_getVisible callback, but I dont know how to reference
the menu.

Thanks


Mike H

Hide menu items
 
Wrapped in a suitable if statement his disable the right click on the sheet tab

Application.CommandBars("Ply").Enabled = False

Re-Enable with true

Mike

"Mike H" wrote:

Apologies I misread your post this disbale right click on worksheet not the
sheet tab.

Mike

"Mike H" wrote:

Hi,

You can use the worksheet event before right click.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If Environ("Username") < "USER" Then
Cancel = True
End If
End Sub

Mike

"Cresta" wrote:

Hello

Could some one point me in the right direction please.

By right clicking on a sheet tab a context menu pops up, I need to hide this
menu so it is not available for a particular file for ceratain uses. I'm
guessing I would us XXX_getVisible callback, but I dont know how to reference
the menu.

Thanks


Gord Dibben

Hide menu items
 
Application.CommandBars("Ply").Enabled = False ' True


Gord Dibben MS Excel MVP

On Tue, 13 Jan 2009 00:49:02 -0800, Cresta
wrote:

Hello

Could some one point me in the right direction please.

By right clicking on a sheet tab a context menu pops up, I need to hide this
menu so it is not available for a particular file for ceratain uses. I'm
guessing I would us XXX_getVisible callback, but I dont know how to reference
the menu.

Thanks



Cresta

Hide menu items
 
Thanks, that worked a treat.

"Cresta" wrote:

Hello

Could some one point me in the right direction please.

By right clicking on a sheet tab a context menu pops up, I need to hide this
menu so it is not available for a particular file for ceratain uses. I'm
guessing I would us XXX_getVisible callback, but I dont know how to reference
the menu.

Thanks



All times are GMT +1. The time now is 02:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com