View Full Version : [SOLVED] How to monitor the built-in ribbon buttons

05-25-2019, 02:24 PM
Hi Exceloholics.

I would like to monitor the clicks of some of the built-in ribbon buttons, e.g. all buttons responsible for sorting. So I would need something that will give me the ID of the clicked built-in button.
Is there a possibility?


Andy Pope
05-28-2019, 01:25 AM
Use can use the Command option for specified idMso.
cancelDefault = False mean the builtin function will still be performed.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" >
<commands >
</commands >
</customUI >

module code

Sub SortAscend_onAction(control As IRibbonControl, ByRef cancelDefault)
MsgBox "Sort Ascend"
cancelDefault = False
End Sub

05-28-2019, 01:50 PM
Thanks Andy. It's not bad. :winking2: Monitors ribbon controls and pop-up menus.
But how to get to the sorting controls in the AutoFilter drop-down menu? I counted on finding IDs (idMso) for these controls, but I did not succeed.


Andy Pope
05-29-2019, 12:59 AM
It does not appear to be a control you can access via ribbon xml.

05-29-2019, 04:50 PM
It looks like we can not interfere with this list.
This thread dispels my hopes: https://social.msdn.microsoft.com/Forums/vstudio/en-US/6513b67e-0876-4eb1-8d58-05b54850c464/fully-disabling-sort-in-excel-2007?forum=vsto

Admittedly, my problem is not completely resolved, but I think it's time to end this topic.

Andy, thank you again.