+ Reply to Thread
Results 1 to 3 of 3

Disable right click

Hybrid View

bhavesh78 Disable right click 01-20-2005, 06:48 PM
theDude Disable Right-Click 01-21-2005, 04:47 PM
bhavesh78 Cool. This code works great.... 01-24-2005, 12:22 PM
  1. #1
    Registered User
    Join Date
    12-29-2004
    Posts
    12

    Question Disable right click

    How can I disable right click on an excel sheet? It should display message saying "Command not allowed .."

    Thanks.

    ~BS

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282

    Disable Right-Click

    Copy this macro to the code page of the worksheet you want to diable the Right-Click event:

    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
    Cancel As Boolean)
    Cancel = True
    Dim msg, title, style
    ' Define user dialog parameters
    msg = "Command not allowed."
    style = vbOKOnly + vbExclamation + vbDefaultButton1
    title = "Invalid User Action"
    ' Display user dialog
    Response = MsgBox(msg, style, title)
    End Sub


    Hope this helps,
    theDude

  3. #3
    Registered User
    Join Date
    12-29-2004
    Posts
    12

    Question

    Cool. This code works great. Is there a similar way for left click too so that a message is displayed or procedure is run when user clicks a menu item like File or Edit.

    Thanks

    ~bhavesh

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1