VBA Mac 2016 I need a substitute for making a temporary commandbar

Jim Gordon

Active Member
Joined
Jul 22, 2011
Messages
305
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2011
Platform
  1. 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:

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?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top