Search notes:

Office Object Model: CommandBars

The CommandBars object is a deprecated way to modify the UI (mostly/exlusively? the menu bar). In Office versions later than 2003, added menu entries appear under the Add-ins tab)

PowerShell: Iterating over commands in CommandBars

$xls = get-activeObject excel.application
 
$cmdBars = $xls.VBE.CommandBars
 
foreach ($cmdBar in $cmdBars){
      $cmdBar.name
      foreach ($control in $cmdBar.controls) {
            "  - $($control.caption) ($($control.id))";
       }
}
Later…
$cmdBarDebug = $cmdBars.item("Debug")
 
$compile = $cmdBars.FindControl(1, 578)
$compile.execute()
}

See also

.executeMso
The root object (VBE) of the VB Editor Object Model exposes a CommandBars collection.
The CommandBars collection in Excel.
Microsoft Office Object Model

Index