Search code examples
excelvbaexcel-2007ribbonexcel-2010

VBA code to add a basic ribbon in Excel 2010?


I have used products to write ribbons for Excel in C# (addin express) but I need to know how to produce a ribbon using vba. Would someone be able to provide me with some code that inserts an additional ribbon into the toolbar for this?

By ribbon I mean where it says "Formulas", "Data", "Review" etc


Solution

  • You can customize the ribbon in Excel using a combination of XML and VBA.

    A good starting-point for customizing the ribbon: http://msdn.microsoft.com/en-us/library/office/aa338202%28v=office.12%29.aspx (The title says Office 2007 but it will work for Office 2010 as well)

    Another good source is the one nutsch mentioned in his comment.

    There is also a free application that helps you design and validate the XML to modify the ribbon called the "Custom UI Editor For Microsoft Office": http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2006/05/25/customuieditor.aspx