Nate123456
New Member
- Joined
- Jul 14, 2015
- Messages
- 2
Hello!
I am currently trying to customize the "right click" or context menu for my project in excel 2010. After doing some online research, I was able to come across some code that seemed fairly straightforward to me for getting rid of menu options I didn't want and adding new ones in.
My overall goal is to get it so that the only options for right clicking a cell are to display, say, 3 options (for now) that run code in VBA. I got almost everything removed, and I was able to figure out how to add new options as well. I'm currently stuck on the "paste options:" section. Looking online, I was not able to find any way to get rid of that particular option.
I was able to use the following example code to get rid of everything else:
and the following code to add new stuff:
however I am still left with "paste options:" and the buttons associated with it (i.e. the little keep text only button for example). Looking online, I found a list of IDs that reference different parts of the context menu (https://support.microsoft.com/en-us/kb/213552), but none of the ones that sounded remotely close did anything to the paste options section. most relevant resources out there describe how to add options, not how to wipe and only setup a few of your choosing.
I'm either wondering if someone out there has a way to get rid of the "paste options:" section, or perhaps a workaround code that wipes out/replaces all the options with new ones. I've searched and searched to no avail
also, that extra popup about the context menu that has the font, color, font size, etc- I'd like to get rid of that too if possible.
Here's what it looks like currently (arrows indicate what I'm looking to get rid of).
Thank you for your time!
Nathan
I am currently trying to customize the "right click" or context menu for my project in excel 2010. After doing some online research, I was able to come across some code that seemed fairly straightforward to me for getting rid of menu options I didn't want and adding new ones in.
My overall goal is to get it so that the only options for right clicking a cell are to display, say, 3 options (for now) that run code in VBA. I got almost everything removed, and I was able to figure out how to add new options as well. I'm currently stuck on the "paste options:" section. Looking online, I was not able to find any way to get rid of that particular option.
I was able to use the following example code to get rid of everything else:
Code:
Application.CommandBars("Cell").Controls("Pick from Drop-Down List...").Delete
and the following code to add new stuff:
Code:
Sub AddItemToContextMenu()
Dim cmdNew As CommandBarButton
Set cmdNew = CommandBars("cell").Controls.Add
With cmdNew
.Caption = "Test1"
.OnAction = "UserForm1load"
.BeginGroup = True
End With
however I am still left with "paste options:" and the buttons associated with it (i.e. the little keep text only button for example). Looking online, I found a list of IDs that reference different parts of the context menu (https://support.microsoft.com/en-us/kb/213552), but none of the ones that sounded remotely close did anything to the paste options section. most relevant resources out there describe how to add options, not how to wipe and only setup a few of your choosing.
I'm either wondering if someone out there has a way to get rid of the "paste options:" section, or perhaps a workaround code that wipes out/replaces all the options with new ones. I've searched and searched to no avail
also, that extra popup about the context menu that has the font, color, font size, etc- I'd like to get rid of that too if possible.
Here's what it looks like currently (arrows indicate what I'm looking to get rid of).
Thank you for your time!
Nathan