Disable Right Click In Excel

C

Celtic_Avenger

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
 
T

Tom Ogilvy

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
 
R

routeram

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
 
Top