By default, if a workbook or Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed.
However, you can configure Excel or any other Microsoft Office application to display messages for errors that relate to the UI. You can use these messages to help determine why a custom Ribbon does not appear, or why a custom Ribbon tab appears without the desired number of controls.
To show add-in user interface errors
However, you can configure Excel or any other Microsoft Office application to display messages for errors that relate to the UI. You can use these messages to help determine why a custom Ribbon does not appear, or why a custom Ribbon tab appears without the desired number of controls.
To show add-in user interface errors
- Click the File tab (in Excel 2010 or later) or the Office button in Excel 2007
- Click Options
- In the categories pane, click Advanced
- In the details pane check Show add-in user interface errors
- Click OK
How To Trigger A Ribbon UI Error
The enabled Option setting can be tested by triggering an intentional UI error.
The split button control is composed of either a button or a toggle button, and a drop-down menu. Its icon and label on the split button come from the button or toggle button element. For more info, please click here.
Both elements of the Ribbon Split button should be defined, otherwise the control cannot be shown in the Ribbon.
The Ribbon Commander VBA code below demonstrates an incomplete split button declaration. The custom UI tab fails to display due to an Office Ribbon error.
The split button control is composed of either a button or a toggle button, and a drop-down menu. Its icon and label on the split button come from the button or toggle button element. For more info, please click here.
Both elements of the Ribbon Split button should be defined, otherwise the control cannot be shown in the Ribbon.
The Ribbon Commander VBA code below demonstrates an incomplete split button declaration. The custom UI tab fails to display due to an Office Ribbon error.
Public Sub CreateUI() With CustomUI .Clear With .ribbon.Tabs.Add(New rxTab) .ID = MAIN_TAB_ID .Label = MAIN_TAB_LABEL .insertAfterMso = "TabDeveloper" With .groups.Add(New rxGroup) With .Buttons.Add(New rxButton) .Label = "Weekly Report" .Size = rxsLarge '> Valid: .imageMso = "CreateReport" .imageMso = "Createreport" End With End With With .groups.Add(New rxGroup) .ID = "undo_group" With .splitButtons.Add(New rxSplitButton) .Size = rxsLarge With .Button .Label = "Test" .imageMso = "Info" End With '> Incomplete SplitButton triggers UI error ---------------- '> uncomment code below to display the control without error ' With .Menu ' With .Buttons.Add(New rxButtonRegular) ' .Label = "Test-1" ' .imageMso = "Help" ' End With ' End With '> --------------------------------------------------------- End With End With With .groups.Add(New rxGroup) '> spaces are invalid in ID .ID = "finance group" End With With .groups.Add(New rxGroup) With .Buttons.Add(New rxButton) .Label = "Weekly Report" .Size = rxsLarge '> Valid: .imageMso = "CreateReport" .imageMso = "Createreport" End With End With End With .Refresh .ActivateTab MAIN_TAB_ID End With End Sub
Ribbon Control Limits
Similar to any other Excel feature, Ribbon controls are subject to max limits:
Office / Excel will not display any additional controls added beyond the Ribbon's max specifications: only the first 4,000 controls added to a group will be shown (without an error warning, if the 'UI error' option is disabled.)
Please enable 'UI error' messages during Ribbon development to ensure that Ribbon limits are not exceeded.
- Max number of controls in a custom Ribbon UI: 10,000
- Max number of controls in a custom Ribbon Group: 4,000
Office / Excel will not display any additional controls added beyond the Ribbon's max specifications: only the first 4,000 controls added to a group will be shown (without an error warning, if the 'UI error' option is disabled.)
Please enable 'UI error' messages during Ribbon development to ensure that Ribbon limits are not exceeded.
- Max number of Buttons or Galleries in a Menu: 1,000
- Max number of items in a Gallery: 1,000
If multiple Galleries are added in a Menu control, besides the gallery controls, every gallery item counts towards the 1,000 menu limit as well.
Caution: Custom Ribbon UIs with any of the errors shown below may not be appear in a custom ribbon.
Control attributes are subject to limits as well. For example the ST_String has a max length of 1024 characters. It is applicable to button attributes such as: .label, .screentip, .supertip and .tag
Button definition: http://msdn.microsoft.com/en-us/library/dd926418(v=office.12).aspx
ST_String: http://msdn.microsoft.com/en-us/library/dd920439(v=office.12).aspx
Button definition: http://msdn.microsoft.com/en-us/library/dd926418(v=office.12).aspx
ST_String: http://msdn.microsoft.com/en-us/library/dd920439(v=office.12).aspx
PowerPoint Ribbon UI Errors
The error below may be shown multiple times, after clicking on a custom Ribbon tab of a presentation or PowerPoint add-in, if the custom images used in the XML code are missing from the customUI area.
You don't need to change your security settings or troubleshoot macros. All you need to do is import the missing images in the OpenXML PowerPoint file.
You don't need to change your security settings or troubleshoot macros. All you need to do is import the missing images in the OpenXML PowerPoint file.