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
-
To download Win 11 Pro 23H2 ISO. (Awaiting moderation)
by
Eddieloh
42 minutes ago -
Manage your browsing experience with Edge
by
Mary Branscombe
1 hour, 20 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
1 hour, 22 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
1 hour, 23 minutes ago -
Apps included with macOS
by
Will Fastie
1 hour, 24 minutes ago -
Xfinity home internet
by
MrJimPhelps
6 hours, 12 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
8 hours, 12 minutes ago -
Debian 12.11 released
by
Alex5723
16 hours, 38 minutes ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
20 hours, 20 minutes ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
2 hours, 5 minutes ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
16 hours, 48 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
1 day, 13 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
1 day, 3 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
1 day, 15 hours ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
1 day, 8 hours ago -
Some advice for managing my wireless internet gateway
by
LHiggins
15 hours, 44 minutes ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
8 hours, 35 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
2 days, 1 hour ago -
Sometimes I wonder about these bots
by
Susan Bradley
1 day, 21 hours ago -
Does windows update component store “self heal”?
by
Mike Cross
1 day, 11 hours ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
2 days, 15 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
23 hours, 19 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
11 hours, 57 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
2 days, 18 hours ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
2 days, 18 hours ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
2 days, 6 hours ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
3 days, 2 hours ago -
0Patch, where to begin
by
cassel23
2 days, 20 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
3 days, 15 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
3 days, 3 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.