PDA

View Full Version : VBA Code to Disable Insert Header & Footer on Ribbon



gazzygazgaz
07-21-2021, 02:12 AM
Hi guys,

VBA newbie here looking to disable/grey out the button for "insert header & footer" on the ribbon on Excel 2016.

I currently already have a module to replace all headers & footers with my desired custom settings but would also like to prevent anybody to edit it.

I have done a search in the forum and on Google but only found older threads for earlier versions of Excel.

Really appreciate any assistance! Thank you.

Jan Karel Pieterse
07-21-2021, 05:18 AM
This isn't easy to do and the Header and footer tab of the page setup dialog will remain available for your users to change the header and footer anyway.
You could add ribbonX code to the workbook in question to disable the "Header and footer" tab of the ribbon that appears in Page Layout view as you click in the header. See: https://rondebruin.nl/win/s2/win006.htm

Paul_Hossler
07-21-2021, 06:38 AM
If you do decide to disable with RibbonX, the best CustomUI editor is at


https://github.com/fernandreu/office-ribbonx-editor

HOWEVER, it's best to read up on Fluent and it's concepts first

There's also a CustomUI forum here where you can ask questions