Under Excel O365, the custom ribbon tab does not always populate

201 views Asked by At

Using an .xlam project with a fully working custom ribbon, I have found that the new tab will sometimes show nothing when clicked on. It is intermittent. The global RibbonUI object is available and running an .invalidate will then show the ribbon. However, the .invlalidate 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.

I am scratching my head trying to find a slick way of making this new custom tab populate 100% of the time.

1

There are 1 answers

0
Crew Reynolds On

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.