VBA noob here... I wanted to give a heartfelt thanks to the contributors to this forum as it has been a wonderful, helpful resource!
Was having the same issue as the OP and I appreciate the thoughtful responses from Jerry, especially in regards to providing links to learn more about various techniques.
Ultimately used the solution provided by Rory, which was very cool,
however I wanted to disable additional controls in the slicer context menu but didn't know how to find out the control names in order to disable them (I only wanted users to be able to sort slicer items from the slicer context menu).
One of the links Jerry provided suggested downloading an Office 2010 add-in that lists the IDs (idMSOs) of context menu controls.
After extensive searching I wasn't able to find this add-in, but I did find the next best thing - a file called,
"Office 2013 Help Files: Office Fluent Users Interface Control Identifiers" at the following link:
Download Office 2013 Help Files: Office Fluent User Interface Control Identifiers from Official Microsoft Download Center
After downloading it, I opened the ExcelControlNames file and filtered the Group/Context Menu Name column by the ContextMenuSlicer item, and the Control Name column contained the names of the controls I needed.
Modified Rory's sample UI code as follows to disable additional controls:
HTML:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<commands>
<command idMso="SlicerShare" getEnabled="slGetEnabled" />
<command idMso="SlicerSettings" getEnabled="slGetEnabled" />
<command idMso="SlicerConnectionsMenu" getEnabled="slGetEnabled" />
<command idMso="SlicerDelete" getEnabled="slGetEnabled" />
<command idMso="SlicerRefresh" getEnabled="slGetEnabled" />
<command idMso="ObjectSizeAndPropertiesDialog" getEnabled="slGetEnabled" />
<command idMso="MacroAssign" getEnabled="slGetEnabled" />
<command idMso="ObjectBringToFront" getEnabled="slGetEnabled" />
<command idMso="ObjectSendToBack" getEnabled="slGetEnabled" />
<command idMso="PasteGalleryMini" getEnabled="slGetEnabled" />
</commands>
<ribbon>
<contextualTabs>
<tabSet idMso="TabSetSlicerTools" getVisible="tbGetVisible" />
</contextualTabs>
</ribbon>
<contextMenus>
<contextMenu idMso="ContextMenuSlicer" >
<button idMso="Cut" getVisible="tbGetVisible" />
<button idMso="Copy" getVisible="tbGetVisible" />
</contextMenu>
</contextMenus>
</customUI>
Hope this helps someone!
Using Excel 2010