I want to clear all items on the Cell context menu using VBA.
I am adding my own 'paste command' to the cell menu and want to remove all other commands and means of paste via the cell menu.
I have used Ribbon X to add a new custom item to the cell menu and I want to clear all other items - ICLUDING the 'Paste Options' sub-menu as below:
I have previously asked on EE and found that there is no RibbonX way (PREFERRED
) to remove all items on the context menu (a very big omission on the part of MS) and that the only remaining option is to use the now depreciated 'CommandMenu' control objects to remove all builtin items. This is done as follows:
Dim cbcCurControl As CommandBarControl
For Each cbcCurControl In CommandBars("Cell").Controls
If cbcCurControl.BuiltIn Then cbcCurControl.Visible = False
This of course works but leaves behind the annoying 'Paste Options' submenu. How can I get rid of this ?