MrExcel Publishing
Your One Stop for Excel Tips & Solutions

disable right click


Posted by Qroozn on January 06, 2002 3:35 PM

How can i disable right click on the mouse.. so that i hide copy/paste.

i've already disabled the control keys on the keyboard.


Posted by Dank on January 06, 2002 3:41 PM

Hi,

If you right click your worksheet tab and choose View Code you can intercept the right click and make it do your own thing or do nothing e.g.

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

You can also make it apply to all sheets in your workbook by putting similar code in the workbook code module e.g.

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

HTH,
Daniel.

HTH,
Dan.

Posted by Jim on January 06, 2002 3:45 PM

Hi Qroozn,

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

If Sh.Name = "Your Sheet Name" Then Cancel = True
End Sub

Jim

Posted by Jim on January 06, 2002 3:51 PM

Posted by Qroozn on January 06, 2002 4:03 PM

thanks Dan... Helped me heaps.