Disable Right Click In Excel

  • Thread starter Thread starter Celtic_Avenger
  • Start date Start date
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
 
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
 
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
 

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