I’ve several automations in the pre-ribbon era that worked very well, scanning for the proper command bar, then for the button within that bar, and activating the action ‘pressing’ to automate detailed actions.
Ribbon UI now removed that ability to find and ‘press’ a COMMAND BAR button. Many MS MVPs had responded to my inquiries that they know of this horrid “chopping off” of functionality, and no MS response to address this shortsighted amputation. And even more horrendous is the MS offer of the backwards, complex, bloated duct-tape means of misusing the UI testing tool to screen-scrape the actions, investigate all over the resulting ‘scrape’ and hopefully find the button holding the MS command you need to perform.
Has anyone found a reliable, non-UI test screen-scraping means to effect the previously 2-VBA LOC access of a command bar then pressing its proper button, in Office 2007/2010/2013+ ??:confused:
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Ribbon removes VBA ability to find and “press” command-bar button
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Ribbon removes VBA ability to find and “press” command-bar button
- This topic has 11 replies, 5 voices, and was last updated 9 years, 5 months ago.
AuthorTopicWSbrrrknee
AskWoody LoungerAugust 22, 2013 at 8:10 am #490662Viewing 3 reply threadsAuthorReplies-
RetiredGeek
AskWoody_MVPAugust 22, 2013 at 8:23 am #1408419Brrrknee,
I’m a little confused? By Command Bar do you mean Custom Tool Bar? If so they should show up on the Add-ins tab.
34764-CustomToolBar
HTH :cheers: -
WSbrrrknee
AskWoody Lounger
-
-
RetiredGeek
AskWoody_MVPAugust 22, 2013 at 11:12 am #1408480Brrrknee,
The only thing I can think of would be to add the commands you need to the QAT (Quick Access Toolbar). HTH :cheers:
-
WSbrrrknee
AskWoody Lounger -
WSjec1
AskWoody Lounger -
WSbrrrknee
AskWoody LoungerAugust 23, 2013 at 6:39 am #1408657
-
-
-
-
Andrew Lockton
AskWoody_MVP -
WSbrrrknee
AskWoody Lounger
-
-
Andrew Lockton
AskWoody_MVPAugust 22, 2013 at 9:27 pm #1408611The MS command bars execute MS commands. If you want to simulate pressing one of those buttons then call the same command as MS do when you click that button.
CommandBars.FindControl(Id:=IDnumber).ExecuteTo find a command’s id you can type into the Immediate Window something like this
?Application.CommandBars(“Menu Bar”).Controls(5).Controls(6).ID
along with
?Application.CommandBars(“Menu Bar”).Controls(5).Controls(6).CaptionYou may even be able to extend this to actually simulate clicking on the button you’ve chosen (I haven’t tested this)
Application.CommandBars(“Menu Bar”).Controls(5).Controls(6).Execute -
WSbrrrknee
AskWoody LoungerAugust 22, 2013 at 10:30 pm #1408614Part of the ribbon issue is that prior “Add Ons” like the Org Chart tool, were able to create and manage a command bar. Fluent UI doesn’t show add-ons’ command bars (109 in my installation, none are Org Chart). OrgChart and its related functions are only seen as Add-ons, with a name and an index (98 of them!). No additional info.
The Fluent UI BROKE a working programmatic means of working with the Org Chart command ‘buttons.’
Without the command interface I was forced to resort to using debug captures of events for selected tabs and menus and entries on menus, then using that hint, when needed I would need to ‘fire’ the command as though it were the selected add-on menu selection. not easy to explain. slightly akin to your ?App investigation via immediate window, but there are no “commands” accessible via VBA to the add on.
-
WSeldrin
AskWoody LoungerDecember 23, 2015 at 2:24 am #1543235Part of the ribbon issue is that prior “Add Ons” like the Org Chart tool, were able to create and manage a command bar. Fluent UI doesn’t show add-ons’ command bars (109 in my installation, none are Org Chart). OrgChart and its related functions are only seen as Add-ons, with a name and an index (98 of them!). No additional info.
The Fluent UI BROKE a working programmatic means of working with the Org Chart command ‘buttons.’
Without the command interface I was forced to resort to using debug captures of events for selected tabs and menus and entries on menus, then using that hint, when needed I would need to ‘fire’ the command as though it were the selected add-on menu selection. not easy to explain. slightly akin to your ?App investigation via immediate window, but there are no “commands” accessible via VBA to the add on.
Dear brrknee,
would you be so kind to explain the method with which you managed to “press” a button of an add-in? I would need to automatize pressing two buttons of the ExcelPython add-in (using Excel 2010), but failed so far.
Thank you very much for the help in advance!
Cheers,
Peter
-
-
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
4 hours, 14 minutes ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
5 hours, 41 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
4 hours, 50 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
14 hours, 59 minutes ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
16 hours, 5 minutes ago -
Disengage Bitlocker
by
CWBillow
6 hours, 3 minutes ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
18 hours, 4 minutes ago -
New Win 11 Pro Geekom Setup questions
by
Deo
2 hours, 45 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
1 day, 1 hour ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
1 day, 1 hour ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
1 day, 5 hours ago -
New PC transfer program recommendations?
by
DaveBoston
38 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
1 day, 9 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
1 day, 9 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
21 hours, 41 minutes ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
1 hour, 44 minutes ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
10 hours, 38 minutes ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
2 days, 4 hours ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
1 day, 2 hours ago -
System Restore and Updates Paused
by
veteran
2 days, 6 hours ago -
Windows 10/11 clock app
by
Kathy Stevens
1 day, 17 hours ago -
Turn off right-click draw
by
Charles Billow
2 days, 10 hours ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
2 days, 13 hours ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
1 day, 7 hours ago -
Master patch listing for June 10, 2025
by
Susan Bradley
2 days, 15 hours ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
1 day, 18 hours ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
2 days, 21 hours ago -
KB5060842 Issue (Minor)
by
AC641
1 day, 9 hours ago -
EchoLeak : Zero Click M365 Copilot leak sensitive information
by
Alex5723
3 days, 4 hours ago -
24H2 may not be offered June updates
by
Susan Bradley
1 day, 20 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.