Using just…
CommandBars.ExecuteMso "MinimizeRibbon"
..fails. Why? Because if the Ribbon is already minimized it will actually maximize. So, you need to check the Ribbon state first…
If Not CommandBars.GetPressedMso("MinimizeRibbon") Then CommandBars.ExecuteMso "MinimizeRibbon" End If