Disable right click

R

Rich Cooper

Hi,
I am trying to figure out how to disable a user from being able to right
click in an excel spreahsheet. If anyone knows how please help!

Thanks
 
T

Thomas Ramel

Grüezi Rich

Rich Cooper schrieb am 14.05.2004
I am trying to figure out how to disable a user from being able to right
click in an excel spreahsheet. If anyone knows how please help!

Open the codemodule of the table and copy the following code to the
codewindow:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
Cancel = True
End Sub

Alt+Q closes the VBA-editor.

--
Mit freundlichen Grüssen

Thomas Ramel
- MVP für Microsoft-Excel -

[Win 2000Pro SP-4 / xl2000 SP-3]
 
R

Ron de Bruin

Hi Rich

You can use this event in the thisworkbook module

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, _
ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub

But you still can right click on the menubars and worksheet tabs.
If you don't want that post back
 
Top