Dealing with Ribbons and Menus – Avoiding Two Versions

Hi all

When you open your Excel 97-2003 file in Excel 2007, one that creates its own menus,
the first thing you notice is that you don’t see your menus. Where’d they go? Then you discover
them – shunted over on the Add-ins tab. Not exactly the ideal user interface.
How are your users going to find them there?

What you want is an application that runs as a first class citizen in Excel 2007, one that takes full advantage
of the ribbon, and yet runs as it always did in Excel 2003. Yet you do not want to maintain two versions of
your app. Two versions are always a nightmare, so difficult to keep in sync.

So, is this possible? Is it possible to have one version that’s at home in Excel 2007 and Excel 2003? Yes it is;
there are two approaches from me and Jim Rech of this problem on this new page on my website.

If you have suggestions or other feedback let me know.

Ron de Bruin

Posted in Uncategorized

8 thoughts on “Dealing with Ribbons and Menus – Avoiding Two Versions

  1. Your approach is interesting. I haven’t analyzed the pros and cons in any detail, but have you considered using a RibbonX Dynamic Menu instead of a commandbar?

    Jim Rech’s approach is one that I believe Jon also uses. It’s a variant of one I shared some time ago in this blog (Teaching an old dog new tricks: A 2007 skin for older add-ins — including some suggestions on how to simplify maintenance of the architecture.

    That said, the final model that I have adopted is different from all previous suggestions. Since I started experimenting with RibbonX I’ve tried and discarded many architectures all aimed at providing a easy way to provide support for multiple versions of Excel including 2007.

    I have a single source file, a XLSM file. It contains the RibbonX material. I “compile” this file as a XLA add-in and a XLAM add-in. There is code in the subroutine that creates a menu that checks if it is running on XL12 (or later) and if it is the XLA file. If so, it asks the user to load the XLAM version.

    In the event the user loads the XLA add-in in XL20007, I first tried to alert her/him and then tried to load the correct one and unload the wrong one. Unfortunately, as in any number of earlier versions of Excel, doing so programmatically is still a crapshoot in that it works sometimes and doesn’t other times. So, I settled to just alerting the user and asking her/him to do the correct thing. It still ties in with my philosophy that users are smart enough to do the right thing just as long as it’s explained properly.

    So, bottom line. Single source file that contains *both* the XML and the code. Two compiled add-ins, one for 2007+ and one for 2003-.

  2. “If [the user is running XL12], it asks the user to load the XLAM version.”

    This might be asking too much of many users. This is what’s nice about the approaches Ron describes. If the user is running XL12, the lightweight XLAM is loaded in addition to the XLA (my variation just does the command bar stuff on the Add-Ins tab if the XLAM isn’t found). So there’s one workbook with the code and the command bar infrastructure, and another very small workbook with the ribbon code. The user doesn’t have to do anything special as the installer drops them both into the appropriate directory.

    An alternative would be to have the installer only install the add-in that matches the installed version of Office.

  3. Hi Tushar

    > but have you considered using a RibbonX Dynamic Menu
    That was the first thing I test with the XML string also in the VBA.
    I like it but for most users it is to difficult to change so I replace it
    for the example with the Table menu.

    The way you do it depend on the kind of users I think.

    I will add the example with the dynamic menu also to the page this week

  4. I was wondering if you had noticed a problem with the dynamic menus where they fail to work if there is no workbook open. Do you know of a solution. It just shows and empty menu.



Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.