{"id":63,"date":"2025-06-13T18:47:04","date_gmt":"2025-06-13T18:47:04","guid":{"rendered":"https:\/\/loufab.alwaysdata.net\/blogaccess\/?p=63"},"modified":"2025-06-13T18:47:04","modified_gmt":"2025-06-13T18:47:04","slug":"vba-afficher-cacher-le-ruban-a-la-demande","status":"publish","type":"post","link":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/2025\/06\/13\/vba-afficher-cacher-le-ruban-a-la-demande\/","title":{"rendered":"VBA : Afficher\/Cacher le ruban \u00e0 la demande"},"content":{"rendered":"\n<p>Cette fois-ci je vous livre l&rsquo;une de mes astuces que j&rsquo;utilise syst\u00e9matiquement dans toutes mes applications :\u00a0Afficher\/Cacher le ruban \u00e0 la demande. <\/p>\n\n\n\n<p>La m\u00e9thode est simple, une variable globale permet de fixer l&rsquo;\u00e9tat du ruban. Un raccourci dans une macro <strong>Autokey <\/strong>permet de changer l&rsquo;\u00e9tat du ruban et une fonction VBA affiche ou cache le ruban suivant l&rsquo;\u00e9tat de la variable.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Option Compare Database \nOption Explicit \n\nDim StateRibbon As Boolean \n\nFunction DisplayRibbon() \n' Auteur : Fabrice CONSTANS (MVP) \n' Description : Affiche\/cache le ruban \n' ctrl+shift+R \nNz StateRibbon, False\u00a0 \n' 1er passage initialise \u00e0 faux \n' (ribbon invisible) \nDoCmd.ShowToolbar \"Ribbon\", IIf(StateRibbon, acToolbarNo, acToolbarYes) \nStateRibbon = Not StateRibbon\u00a0 ' inverse la valeur \n\nEnd Function\n<\/code><\/pre>\n\n\n\n<p>Le raccourci : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>+^{R}\u00a0 ExecuterCode DisplayRibbon()<\/code><\/pre>\n\n\n\n<p>Cacher le ruban permet de cacher \u00e9galement les boutons Restaurer\/ Fermer ce qui\u00a0donne une touche professionnelle \u00e0 l&rsquo;application.<\/p>\n\n\n\n<p>Bonne utilisation !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cette fois-ci je vous livre l&rsquo;une de mes astuces que j&rsquo;utilise syst\u00e9matiquement dans toutes mes applications :\u00a0Afficher\/Cacher le ruban \u00e0 la demande. La m\u00e9thode est simple, une variable globale permet de fixer l&rsquo;\u00e9tat du ruban. Un raccourci dans une macro &hellip; <a href=\"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/2025\/06\/13\/vba-afficher-cacher-le-ruban-a-la-demande\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,6],"tags":[11,7],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-access","category-code-vba","tag-access","tag-code-vba"],"_links":{"self":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/comments?post=63"}],"version-history":[{"count":1,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts\/63\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/media?parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/categories?post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/tags?post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}