Ribbon & Ribbon Tabs

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,600
Office Version
  1. 365
Platform
  1. Windows
When I worksheet is selected I want to hide the ribbon but show the ribbon tabs to allow the user to still access the ribbon functions.

Also when another file is selected I want the Workbook_Deactivate to check if the Ribbon is visible and if not to make it visible again.

I can find code to hide the ribbon and ribbon tabs but nothing to leave the ribbon tabs and to also check whether it's currently visible or not.


TIA
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Are you talking about switching between sheets or workbooks?
 
Upvote 0
Are you talking about switching between sheets or workbook
Yes, when a different workbook is selected I need to detect the visiblity of the ribbon and make visible if not visible.
 
Upvote 0
Ok how about
VBA Code:
Private Sub Workbook_Activate()
   If Application.CommandBars("Ribbon").Height > 100 Then
      Application.CommandBars.ExecuteMso ("MinimizeRibbon")
   End If
End Sub
 
Upvote 0
This doesn't work.

Even when the ribbons are hidden (with just the ribbon tabs visible - File, Insert, etc) the height is the same as when visible and therefore, doesn't make it visible again.
 
Upvote 0
The user can specify whether they want the following display or not
1604587638242.png


If they have the above display set I then need to select the Show Tabs and Commands (as below) when the workbook is deactivated
1604587559147.png
 
Upvote 0
Sorry...I have just tried this again and it does work. I think I manually played with the ribbon that returned the same height as when visible.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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