Reputation: 27
Using an .xlam project with a fully working custom ribbon, I found the new tab will sometimes show nothing when clicked on. The global RibbonUI object is available and running an .invalidate
will then show the ribbon.
The .invalidate
attempts prior to the tab being viewed do not seem to change this behavior. I have to view the tab and then run the .invalidate
manually (with a macro button) to see the ribbon appear.
How do I make this new custom tab populate 100% of the time?
Upvotes: 0
Views: 306
Reputation: 27
For the benefit of those that come across this issue, I have found the root cause and a solution. This is Excel O365 specific.
If you have a custom ribbon tab set up and working, try this. Open Excel, create a blank workbook, then double-click on a cell to put it in "edit mode". Click on your custom ribbon tab. Blank, right?
This "cell in edit mode" is what was causing Excel O365 to fail to show my custom ribbon. Excel O365 starts up on the "File" screen. Prior versions always opened to a blank sheet. If you click on "Blank workbook", the ribbon displays fine. If you DOUBLE-CLICK on "Blank workbook", the first click opens the workbook and the second click puts a cell into ""edit mode". In this state, clicking on your custom ribbon tab shows nothing.
The work-around
Private Sub WorkbookActivate(ByVal Wb As Workbook)
Application.SendKeys "{ESC}"
...
You may see a cell go into edit mode for one blink but it then exits edit mode. Click on your custom ribbon tab. It will now show the ribbon controls as designed.
Upvotes: 0