Pages

Tuesday, April 17, 2007

Disable Right Click

You can use the following function to disable mouse click. Right Click

This will disable popup menu

Sub Disable_Right_Click()

' ---------------------------------------------------------------
' Written By Shanmuga Sundara Raman for http://vbadud.blogspot.com
' ---------------------------------------------------------------

' This will disable mouse right click on worksheets

Application.CommandBars("Cell").Enabled = False

End Sub


D

2 comments:

  1. this is not working on my excl sheet

    ReplyDelete
  2. Anonymous1:52 AM

    Thanks a lot for your suggestion. Now, I could also disable row and column now, here is the code :

    Private Sub worksheet_activate()
    Application.CommandBars("Row").Enabled = False
    Application.CommandBars("Column").Enabled = False
    Application.CommandBars("Cell").Enabled = False
    End Sub

    Private Sub worksheet_deactivate()
    Application.CommandBars("Row").Enabled = True
    Application.CommandBars("Column").Enabled = True
    Application.CommandBars("Cell").Enabled = True
    End Sub

    Regards,
    Suyadi
    oji1997@yahoo.com

    ReplyDelete