How can I implement a global customization to the Excel 2007 Ribbon using VBA code?

We have an existing solution for Excel (2000-2003) that works like this:

We customized a worksheet with a commandbar and some VBA code. The commandbar causes the VBA code to run and good things happen. This worksheet is placed in the directory for documents that get loaded when excel loads. (XLSTART or something like that). The result is a sort of "global" solution without writing a full-on "add-in". Any time the user opens excel, they get the command bar because it's a part of the worksheet that got automatically loaded (even though it's hidden).

I would like to move this solution to work on Office 2007 but with custom integration on the ribbon rather than the automatic translation that puts this command-bar into the "Add-Ins" tab.

When I try the same approach, but with 2007, I'm a bit disappointed. I started by making some customUI xml and putting it in a macro enabled excel document (xlsm). I wrote some VBA to handle the button click and hooked it up in the .rels file.
If I just put this document in the XLSTART directory, it gets loaded and behaves very nicely. The problem is that people don't want to edit my xlsm template document, but rather a new document which should have opened also.
If I mark the xlsm sheet as "hidden" to prevent it from getting directly edited, excel opens with no open document. If the user is smart enough to create a new worksheet, this new sheet won't have my customizations. Only the hidden one has the cool new UI which doesn't help the user on their worksheet.

So I thought about using VSTO 2005 for Office 2007 to create an add-in.

The problem here is that it looks like VSTO only supports .NET code, but I want to keep using the same VBA code that we've been using for ever.


So I guess the real question is this:

How can I implement a global customization to the Excel 2007 Ribbon using VBA code

Thanks in advance for any help.

--Nick



Answer this question

How can I implement a global customization to the Excel 2007 Ribbon using VBA code?

  • K::ot???ter

    I ended up using Visual Studio 6 and was quite satisfied for relatively basic customizations, but quickly realized that C# would be much better and switched to VSTO in the end anyways.
  • How can I implement a global customization to the Excel 2007 Ribbon using VBA code?