ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable right click (https://www.excelbanter.com/excel-programming/298310-disable-right-click.html)

Rich Cooper

Disable right click
 
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



Thomas Ramel

Disable right click
 
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]

Ron de Bruin

Disable right click
 
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

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Rich Cooper" wrote in message ...
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






All times are GMT +1. The time now is 05:49 PM.

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