VBA code to add a basic ribbon in Excel 2010?

女生的网名这么多〃 提交于 2020-01-01 17:48:39

问题


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


回答1:


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




回答2:


There is a simple trick to it - the xml is to be included in your .xlsm file.

See this link How to add a custom Ribbon tab using VBA?



来源:https://stackoverflow.com/questions/13125751/vba-code-to-add-a-basic-ribbon-in-excel-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!