Jim Gordon
Active Member
- Joined
- Jul 22, 2011
- Messages
- 305
- Office Version
- 365
- 2021
- 2019
- 2016
- 2011
- Platform
- MacOS
In previous versions of Excel I could make a temporary commandbar that held a control that I could "click" programmatically. Here's an example:
Attempting to add a commandbar crashes XL 2016 Mac. Is there an equivalent way to make a temporary button in the Ribbon and execute that command?
Code:
'Make a temporary commandbar with the button that fires the flag for followup dialog
Set TempBar = CommandBars.Add(Name:="FlagDialog")
'
'Put the flag for followup command onto the TempBar temporary toolbar
Application.CommandBars("FlagDialog").Controls.Add Type:=msoControlButton, Id:=8476, Before:=1
'
'Click the button on the temporary commandbar to display the flag for follow-up dialog
Application.CommandBars("FlagDialog").Controls(1).Exec
Attempting to add a commandbar crashes XL 2016 Mac. Is there an equivalent way to make a temporary button in the Ribbon and execute that command?