Adding Ribbon support to Excel COM Addin
Question
I have a MS Office COM addin written in C# (Visual Studio 2005) and uses a COM Shim dll. The addin DOES NOT use VSTO technology and supports Excel XP and higher. The addin adds a new toolbar and a menu.
The addin works fine in Excel 2007 but it is displayed in a separate tab named "AddIns" along with its toolbars and menu. I want integrate this addin with the Excel 2007 ribbon toolbar and create a new tab with groups and buttons.
I went through a number of articles and found that IRibbonExtensibility is the interface that will be used for Ribbon support. Also, the COM Shim Wizards has a new version 2.3 that supports ribbon interface.
I want to know whether it can be done and the changes that will be required in the project.
- Currently, OfficeXP's office.dll file is used in the project (v 7.0). But the IRibbonExtensibility interface is in Office 2007's dll (v12). So I think the first thing that I need to do is to change this dll and update all reference in code. Will this dll support previous versions (backward compatible)? I dont want to break the existing functionality.
- What will the changes in COM Shim dll?
Solution
I havent used OfficeXP, but have built COM AddIns against 2000, 2003 and 2007.
I recently built a COM AddIn for Office 2007 using the IRibbonExtensibility interface, with references to the v12 PIAs.
When I used this with Office 2003, I found it worked pretty well. However, my AddIns is only providing some very basic functionality and not using many calls onto the Excel objects. I adjusted the OnConnection method to set up the CommandBars only if the Applicaiton.Version was less than 12.
There were no code changes that I remember needed to switch from 2003 PIAs to 2007 PIAs. In the past have found you can switch between different versions of the PIAs with minimum effort.
James