Custom IRibbonUI loads inconsistently only on Mac

bsimms

New Member
Joined
Aug 8, 2019
Messages
1
Hello there,

I have an extensive custom excel add-in which engages in all sorts of macros when opening certain files (tests are done on workbook open before performing any of the macros) and the add-in includes a custom ribbon. Until recently this add-in has only been used on windows, but I've recently been working on getting it functional on Mac as well.

If I open a new, clean workbook in Excel, the ribbon loads fine every time. The issue that I'm having arises when I try to open one of my special files which engage all of the complex macros. In these cases the ribbon loads inconsistently. Sometimes the ribbon will load once all of the Workbook_Open macros finish running, but most of the time it won't. I've checked to see if the on_Load code fires in these cases and it does not. An IRibbonUI never gets assigned.

Given what I've seen, it seems to me like some process that happens while all my workbook_open macros are firing off is interfering with the ribbon's on_Load callback, and I'm not sure how to address it.

My code is typical for loading a custom ribbon:
Code:
Option Explicit

Private myRibbon As IRibbonUI
Private CollapseToggle As Boolean

Public Sub ribb******er(ribbon As IRibbonUI)
    Set myRibbon = ribbon
    CollapseToggleState = True
End Sub

The CollapseToggleState is a global variable that controls one of the toggle buttons in my ribbon which I set to true by default.

Is there a way to ensure that the ribbon loads before or after all of the other macros run? I've tried using an Application.Wait within the on_Load callback, but this did nothing. I've also tried putting the on_Load callback in ThisWorkbook and making the ribbon Public rather than keeping the on_Load callback in the module with the rest of the ribbon code. I'm at a loss since I can't reproduce the issue consistently and I'm not as familiar with the workings of Excel on Mac as I am on Windows.

Note, this is never an issue on my windows version of Excel, with the same exact code. I would love to hear any recommendations of things to try or ways to debug this issue. Thanks in advance and please let me know if there is any other information I can provide that would be helpful.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top