ExcelBanter

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

Celtic_Avenger[_26_]

Disable Right Click In Excel
 
If it is possible...........

Is there any way using VBA that I can disable the right mous
button......Why.......I need to stop users from being able to use th
copy and paste functions both on the mouse and on the keyboar
shortcuts.

Is there a way to do either or both of these?

Thanks

Celtic_Avenger
:confused: :confused: :confused: :confused

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Disable Right Click In Excel
 
In the thisworkbook module

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


look at help in VBA at OnKey to see how to redefine Ctrl+C, Ctrl+V and
Ctrl+X

--
Regards,
Tom Ogilvy


"Celtic_Avenger " wrote in
message ...
If it is possible...........

Is there any way using VBA that I can disable the right mouse
button......Why.......I need to stop users from being able to use the
copy and paste functions both on the mouse and on the keyboard
shortcuts.

Is there a way to do either or both of these?

Thanks

Celtic_Avenger
:confused: :confused: :confused: :confused:


---
Message posted from http://www.ExcelForum.com/




routeram[_2_]

Disable Right Click In Excel
 
Hi,

I don't know if copy can be disabled totally. Whatever you do you
cannot prevent the user from using the Printscreen to save what is seen
on the screen.

To disable right click.
right click on the sheet you want to diaable right click and select
'View code'. Paste the code below.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
MsgBox ("Sorry I can't allow you to do that")
End Sub

Regards,
Ram


---
Message posted from http://www.ExcelForum.com/


Celtic_Avenger[_27_]

Disable Right Click In Excel
 
Thanks Once Again Tom...........

Celtic_Avenger
:) :cool: :) :cool: :

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 07:14 PM.

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