Disable right click

  • Thread starter Thread starter Rich Cooper
  • Start date Start date
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
 
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]
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top