Hi all
I'm trying to add VBA to hide the ribbon on workbook activation however leave the ribbon tab headings visible, I have it working in that upon opening the workbook in question it minimises the ribbon and leaves the headings visible
The issue is it's then impacting other Excel workbooks when opened by also hiding the ribbon which I don't want
This is my existing code which as I say kind of works but not as needed
In the past I've used code for full screen which works and doesn't impact other sheets but it doesn't suit my needs for the new workbook
Is the issue because I'm using SendKeys or is there anything else I can add to my code that will ensure it only impacts the workbook in question?
Failing that does anyone have any suggestions on alternative code to minimise the ribbon and leave the ribbon tab headings and save icon etc visible?
Many thanks
Greg
I'm trying to add VBA to hide the ribbon on workbook activation however leave the ribbon tab headings visible, I have it working in that upon opening the workbook in question it minimises the ribbon and leaves the headings visible
The issue is it's then impacting other Excel workbooks when opened by also hiding the ribbon which I don't want
This is my existing code which as I say kind of works but not as needed
Code:
Private Sub Workbook_Activate()
If Application.CommandBars("Ribbon").Height > 60 Then
Application.SendKeys "^{F1}"
End If
End Sub
Private Sub Workbook_Deactivate()
If Application.CommandBars("Ribbon").Height < 60 Then
Application.SendKeys "^{F1}"
End If
End Sub
In the past I've used code for full screen which works and doesn't impact other sheets but it doesn't suit my needs for the new workbook
Code:
Private Sub Workbook_Activate()
Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = True
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_Deactivate()
Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
Application.ScreenUpdating = True
End Sub
Is the issue because I'm using SendKeys or is there anything else I can add to my code that will ensure it only impacts the workbook in question?
Failing that does anyone have any suggestions on alternative code to minimise the ribbon and leave the ribbon tab headings and save icon etc visible?
Many thanks
Greg