VBA auto hide ribbon in Excel 2013 -
how auto-hide ribbon
in excel 2013 in vba? achieve clicking on upper arrow icon @ right top of excel menu marked blue in picture below , clicking on first option marked orange:
i interested in vba switching third option show tabs , commands
. important thing me keep in excel menu upper arrow icon (marked blue).
i have tried hints shown in thread: vba minimize ribbon in excel not satisfied results.
attempt 1
application.executeexcel4macro "show.toolbar(""ribbon"",false)
this hides blue icon.
attempt 2
commandbars.executemso "minimizeribbon"
this close want. keeps blue icon not hide entire menu. switches second option displayed in picture show tabs
.
attempt 3
sendkeys "^{f1}"
the attampt not work @ all. moreover, supposed imitate attempt 2. not satisfy me.
i can't see else has brought up... isn't workaround, actual idmso think you're looking for. code makes excel window gone same way first option auto-hide ribbon
.
before code runs, window looks this, in 'restore' size:
running following code:
sub hidetheribbon() commandbars.executemso "hideribbon" end sub
will make window this, in maxamized window size (just happen if press auto-hide ribbon
button manually):
if want ribbon automatically hidden when workbook opens, put in workbook code:
sub workbook_open() commandbars.executemso "hideribbon" end sub
alternatively, achieve same thing, put code in module:
sub auto_open() commandbars.executemso "hideribbon" end sub
if want window revert normal, run exact same code again. in other words, following code make no visual change @ when ran because idmso "hideribbon" togglebutton:
sub hidetheribbon() commandbars.executemso "hideribbon" commandbars.executemso "hideribbon" end sub
if want full list of idmso in excel, click following apply you: excel 2013+, excel 2010, excel 2007
Comments
Post a Comment