Professional Documents
Culture Documents
Ribbonx Visual Editor
Ribbonx Visual Editor
Ribbonx Visual Editor
htm
Although the add-in has been tested and create a backup file when used there is always the potential for an error to lead to the corruption of a workbook. Therefore I strongly
recommend that you take your own copy of the file before using the designer.
The RibbonX Visual Designer is a VBA add-in designer to help with the construction of Ribbon interfaces. The add-in will now work with PowerPoint and Word files as well as Excel.
In order to construct and preview files in PowerPoint or Word the add-in will attempt to reference the correct version of the application. If you have versions prior to 2007 installed then you may
need to manually open the relevent application before opening the designer or loading RibbonX. Under normal circumstances the correct version of the application will be opened if no
instances are currently open. If you recieve the warning message simply save and close any open instances of the application before trying again. Obviously this is not an issue when working
with Excel files.
When the add-in is loaded 2 new buttons will appear on the Developer Tab.
The Designer menu contains the Office Applications that can now be used.
1 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Use the Load RibbonX to work with existing Excel files even if they do not currently contain ribbonx code. You can import, modify, preview and save the files ribbonx information.
Use the Designer to create, preview and save a new file with ribbonx information.
Note:
In order for the RibbonX Visual Designer to modify a file it must check that the file is not currently open. This task requires access to the VBA Project object model.
Therefore you need to enable this property manually.
Use Office Button > Excel Options > Trust Center > Trust Center Settings > Macro settings.
With the designer loaded you can modify built-in items such as the visibility of a Tab or Group. Or more likely you can create your own custom interface.
To build you custom interface start by selecting the node that will act as the parent of the item you wish to add.
So to add a new Tab [ ] select the Tabs node [ ]in the Ribbon view. You can then select the Tab [ ] item from the toolbox and either double-click or use the Insert Item button
Properties
The details of the selected item in the Ribbon are displayed in the Properties list.
Load RibbonX allows you to import, modify, preview and eventually save a files existing ribbonx information.
Designer allows you to create, preview and eventually save a file with ribbonx information.
The program can handle .xlsx, .xlsm and .xlam workbooks.
With the designer loaded you can modify built-in items such as the visibility of a Tab or Group. Or more likely you can create your own custom interface.
To build you custom interface start by selecting the node that will act as the parent of the item you wish to add.
So to add a new Tab [ ] select the Tabs node [ ]in the Ribbon view. You can then select the Tab [ ] item from the toolbox and either double-click or use the Insert Item button
Properties
The details of the selected item in the Ribbon are displayed in the Properties list.
2 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Dropdown list of predefined options. e.g. the size property can be normal or large; enabled property can be true or false.
Textbox where descriptive text or values can be entered. e.g. the label or supertip properties.
Mso Image selector for picking of built-in imageMso property. The size of images displayed will depend on the setting of the size property.
When selected a sub form will display available icons. The image size in the gallery is dependent upon the current setting of the size property.
On the sub form both the large and small icon is displayed for the selected icon.
The add-in will display a viewer containing all existing imagery for the file. The Browse button can be used to add new images.
3 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Please note that if you are using .png graphics and callback routines to dynamically load files you will require additional coding routines to enable the loading of png files.
Fortunately Stephen Bullen has posted a file with the required codes. LoadPictureGDI
Callbacks
Available callbacks are displayed in the Callbacks list.
When you check the callback an automatic routine stub name is created. You can change this, if for example you are using a single callback routine to handle the same event across
multiple items.
CustomUI XML
This is a read-only copy of the information that will be written to the file.
Only for use if you want to manually maintain your files. You can copy this to the clipboard.
4 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Callback Stubs
This is a read-only copy of vba callbacks that you can copy and paste into your file.
The code does not include any additional variable declaration required to make the VBA function.
Only for use if you want to manually maintain your files. You can copy this to the clipboard.
As well as the Insert Item [ ] there are controls for moving and removing custom items within the Ribbon.
Delete Item [ ] will remove the selected item and all items contained within from the ribbon.
Move Item Up [ ] will move the selected item up, taking along all items contained within.
Move Item Down [ ] will move the selected item down, taking along all the items contained within.
Demote Item [ ] will move the selected item within the item immediately below it, taking all the items contrained within.
Premote Item [ ] will move the selected item out of and below the containing item, taking all the items contained within.
5 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Clone Item [ ] will create a copy of the selected item and all the items within it.
All the properties and callbacks will be copied. The Id property will be a unique defalt value.
The these controls it is possible to nest items within each other. e.g buttons within menus, or Items within a Gallery.
All of the movement buttons will only perform the task if it is valid.
Controls
I have created a set of example files demonstrating the various controls that can be used on the ribbon. There are Excel, PowerPoint and Word versions.
Download ControlGallery
Demonstrates the use of Box, Button Group, Label and Separator formatting items.
6 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Office Menu
You can also add ribbonx to the Office menu [ ].
Download OfficeMenu
Document controls will only appear when the specific workbook has focus.
7 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Results in the following appearance of the ribbon. Note the borders around the icons which denote they are document specific.
Download QATDocument
Download QATShared
8 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Contextual Tabs
Results in the following appearance of the ribbon when a Chart or Chart object is selected
Download ContextualTabs
Namespace
By using a namespace you can allow multiple files to share parts of the ribbon use customize.
The following screen shots show the properties of 2 workbooks with both private and shared sections of the ribbon.
9 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Which results in the following appearance of the ribbon when NamespaceA.xlsm is active.
Which results in the following appearance of the ribbon when NamespaceB.xlsm is active.
Download Namespaces
10 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Command
By using the Command item you can repurpose the built-in function of buttons. The following repurposes the Bold button.
11 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
In the download file I have added a simple message box rxBold_repurpose routine.
Download Commands
To replace existing add-in with later version you simply need to overwrite the existing add-in. Make sure Excel is not running otherwise you will not be able to replace the file.
Version History
Word and PowerPoint example files for ControlsPart3 has been amended slightly as the dynamic gallery was not populating when used with Office 2010
Bug fix Office Button menu entry points where not working
Bug fix when handling incorrect application version for PowerPoint and Word
Bug fix for handling image formats not supported by VBA controls that maybe valid for use in the ribbon
12 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
Additional coding to the XML class for the customUI relationship to the rels file.
I also made extensive use of the RibbonX book Customizing the Office 2007 Ribbon By Robert Martin, Ken Puls, Teresa Hennig
Including trying all the example download files.
The following error messages may be encountered if you do not have the required libraries registered on your pc.
"Cannot run the macro btnLoadFile_click. The macro may not be available in this workbook or macros maybe disabled"
Libraries
13 of 14 27/06/17 14.25
Ribbon Editor http://www.andypope.info/vba/ribboneditor.htm
14 of 14 27/06/17 14.25