Hi I am trying to minimise the ribbon in workbook when it loads using the following code:
Frustratingly it checks the the ribbon height ok, but all sendkeys ends up doing is showing Excel help, rather than minising the ribbon. For some reason it is not picking up ^ as 'ctrl'.
Can anyone help? I do only want the ribbon minimised and not hidden, so the the user can still access excel's menus.
Code:
Private Sub Auto_Open()
If CommandBars("Ribbon").Height > 100 Then
Application.SendKeys "^{F1}", False 'make sure ribbon is minimised
MsgBox ("minimised")
End If
End Sub
Frustratingly it checks the the ribbon height ok, but all sendkeys ends up doing is showing Excel help, rather than minising the ribbon. For some reason it is not picking up ^ as 'ctrl'.
Can anyone help? I do only want the ribbon minimised and not hidden, so the the user can still access excel's menus.