Custom Right Click Menu
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Custom Right Click Menu

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Having read previous posts on similar subjects, I can not find a satisfactory solution to my requirements.

    I wish to almost entirely remove the right click menu apart from the Clear Contents option but have only come across ways to disable the menu completely.

    Is it possible to use something similar to
    Application.CommandBars("Right Click Menu").Controls _
    ("Options...").Enabled = False

    Is this possible or am I going to have to rethink my strategy?

    [ This Message was edited by: Mr Nick on 2002-04-03 07:06 ]

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try the following code:

    For Each c In Application.CommandBars("Cell").Controls
    If c.Caption <> "Clear Co&ntents" Then c.Delete
    Next

    Use the following code to reset it to the default values:

    Application.CommandBars("cell").Reset

    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Where exactly does this code need to be entered? I've tried it under Workbook_Open and also under Workbook_Activate but either these are the wrong positions or the code itself does not work?

    Any ideas?

  4. #4
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-03 23:02, Mr Nick wrote:
    Where exactly does this code need to be entered? I've tried it under Workbook_Open and also under Workbook_Activate but either these are the wrong positions or the code itself does not work?

    Any ideas?
    Hi Nick the code goes into the Thisworkbook
    object module

    eg.


    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.CommandBars("cell").Reset
    End Sub

    Private Sub Workbook_Open()
    Dim C
    For Each C In Application.CommandBars("Cell").Controls
    If C.Caption <> "Clear Co&ntents" Then C.Delete
    Next
    End Sub




    Kind Regards,
    Ivan F Moala From the City of Sails

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Well, as I said, I have already tried it in this position and have tried it again but absolutely nothing changes on my right click menu.

    I'm using Excel 97 if that makes any difference.

    HELP!

  6. #6
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-04 01:01, Mr Nick wrote:
    Well, as I said, I have already tried it in this position and have tried it again but absolutely nothing changes on my right click menu.

    I'm using Excel 97 if that makes any difference.

    HELP!
    Silly Question but...Have you saved / closed / then opened up the File ?
    Kind Regards,
    Ivan F Moala From the City of Sails

  7. #7
    Board Regular
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Many, Many times - believe me.

    I have tried numerous ways to get this to work but still nothing!

  8. #8
    Board Regular
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Oh Dear - the plot thickens!

    I just opened a different workbook and then returned to the one in question and find that Right Click is now completely disabled. Whats more worrying is the fact that I have deleted this code out of the sheet but right click is still gone. Right clicking is however, still available in new books??

    Where will it all end?

    [ This Message was edited by: Mr Nick on 2002-04-04 01:33 ]

  9. #9
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    What version of excel are you running, because I swear the code works for me?

  10. #10
    Board Regular
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    I'm using Excel 97. I've now got to a point where I have managed to completely disable the right click option and have built a custom toolbar with the options I require on that. I just need to lock this down so it isn't customizable and that'll do for what I need.

    Thanks for the replies.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com