1
votes

I have a custom ribbon add-in for Excel 2007 which is producing an error under certain specific circumstances. The error window is a vbCritical type error with a red X and is completely blank with a single "OK" button. An error is produced for each of the 20 or so commands in the ribbon, causing the user to click multiple times to clear the errors, after which normal execution resumes with no discernible effect to operation.

From my research thus far I have determined that this occurs in Excel 2007 when certain ribbon actions are attempted by Excel in the background when Excel is not the topmost active window.

In my case, it occurs infrequently when creating a new workbook and every time a macro command from the add-in is attempted to be added to the quicktools menu. I believe this is because the quicktools window is on top of the active Excel instance.

Other threads on the subject have suggested that Ribbon.Invalidate, called when it cannot be immediately executed, will produce the error. Also, whenever "getVisible" or "getEnabled" UI commands are executed. However, I am not calling Ribbon.Invalidate anywhere during a thread, only in isolation and after altering key-bindings, neither of which is executed on workbook creation or assigning commands to quicktools. Additionally I am not utilizing the "getVisible" or "getEnabled" commands anywhere in the customUI.xml or VBA code.

I'm at a loss at this point. Any help that can be provided will be very much appreciated.

1

1 Answers

0
votes

After some additional research, I finally discovered the source of the error.

It was neither a call to Invalidate, nor a bad command. Instead, it turns out it was because I was using a non-16x16 sized image that was not a Microsoft standard image (imageMSO) file.

Screwy error. It looks like there is no way to counter it if I intend to use custom icons (I do). I very much dislike that functionality.