VBA to Collapse Formula Bar in Excel 2021 Mac

SanjayGMusafir

Well-known Member
Joined
Sep 7, 2018
Messages
1,513
Office Version
  1. 2024
Platform
  1. Windows
Hi Experts
I have been trying to figure out some way to reset my Formula bar after I have completed my task(s). Looking for VBA that I can add to serve the purpose.

Found some apparent solutions, but none of them seem to be working. Got 2, but both give different errors while running.

Can you help me find a better solution to it?

Thanks

The VBA codes I got from internet are as below -

VBA Code:
'To Collapse Formula Bar
Application.DisplayFormulaBar = True 'to Show/hide formula bar
CommandBars.ExecuteMso "MinimizeRibbon" 'Excel Gives Debug Error on this
Application.FormulaBarHeight = 3 'Excel Closes with Error if I use this
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I was wondering why I didn't get any replies... So thought of trying the code in windows
VBA Code:
Application.FormulaBarHeight = 3
It works perfect in Windows but for some reason gives error in Mac
Hope this information helps someone who reaches this thread...

Still, hoping someone may be able to give solution to my problem or at least explain why mac gives error while in windows it works perfectly.
 
Upvote 0
Hi Sanjay, its normally you helping other people ;)
I don't have access to a Mac, so just did some googling.
I suspect that the issue while not identical is related to the fact that Ribbon controls are not fully supported on a Mac.
ie per the link below: "Office 2016 for Mac apps don't support some of the idMSOs that Office for Windows supports."

I thought you might be able to use send keys, since you can expand & collapse that box using Ctrl+Shift+U, but it looks like that may also not be possible using VBA on a Mac.

Sorry I don't have a solution for you but hope the above helps.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
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