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
-
You can’t handle me
by
Susan Bradley
51 minutes ago -
Chrome Can Now Change Your Weak Passwords for You
by
Alex5723
5 hours, 5 minutes ago -
Microsoft: Over 394,000 Windows PCs infected by Lumma malware, affects Chrome..
by
Alex5723
6 hours, 12 minutes ago -
Signal vs Microsoft’s Recall ; By Default, Signal Doesn’t Recall
by
Alex5723
6 hours, 24 minutes ago -
Internet Archive : This is where all of The Internet is stored
by
Alex5723
6 hours, 36 minutes ago -
iPhone 7 Plus and the iPhone 8 on Vantage list
by
Alex5723
6 hours, 41 minutes ago -
Lumma malware takedown
by
EyesOnWindows
13 hours, 55 minutes ago -
“kill switches” found in Chinese made power inverters
by
Alex5723
15 hours, 29 minutes ago -
Windows 11 – InControl vs pausing Windows updates
by
Kathy Stevens
15 hours, 23 minutes ago -
Meet Gemini in Chrome
by
Alex5723
19 hours, 28 minutes ago -
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
19 hours, 37 minutes ago -
Trump signs Take It Down Act
by
Alex5723
1 day, 3 hours ago -
Do you have a maintenance window?
by
Susan Bradley
14 hours, 45 minutes ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
5 hours, 48 minutes ago -
Cox Communications and Charter Communications to merge
by
not so anon
1 day, 6 hours ago -
Help with WD usb driver on Windows 11
by
Tex265
1 day, 12 hours ago -
hibernate activation
by
e_belmont
1 day, 15 hours ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
1 day, 19 hours ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
1 day, 22 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
1 day, 22 hours ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
18 hours, 49 minutes ago -
Out of band for Windows 10
by
Susan Bradley
2 days, 3 hours ago -
Giving UniGetUi a test run.
by
RetiredGeek
2 days, 10 hours ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
2 days, 18 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
13 hours, 49 minutes ago -
Auto Time Zone Adjustment
by
wadeer
2 days, 22 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
2 days, 20 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
1 hour, 13 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
1 day, 13 hours ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
13 hours, 18 minutes 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.