In this second post about IRibbonExtensibility I will show how we can use the library with an unmanaged COM Add-in developed in classic VB. To read the first post on the subject please see:
Creating a standalone type library for IRibbonExtensibility
#1 Make a reference to the library
The filename of the attached library in the previously blogpost is XLRibbonExtensibility.tlb but its library name is XLRibbonExtensibility Object Library (which is viewed in the helpstring section on top of the tlb file) . The later is showed in the Reference dialog in classic VB which we should set a reference to in the VB Project.
#2 Implement the library
On top of the classmodule Connection we add the following expression:
#3 Create the necessary procedures
Before we compile the DLL we need to add some procedures in the Connection class. These procedure are available here.
#4 Creating the configuration XML file for the Ribbon in Excel 2007
The XML file that is used here is included in the attached file RibbonX.zip (see below).
#5 Do we actually need to ship the XLRibbon.tlb file with the solution?
No – We only need it during the developing process.
The implements statement as above and all procedures that is targeting the IRibbonExetensibility are disregarded when installed on a targeting computer, for instance with Excel 2000 installed.
However, if You get some issues due to the use of this approach You should include the TLB file in the setup package.
Despite the above I still want to know if it legal or not to extract the IRibbonExtensibility information from the MSO.DLL file.
If You want to take part of the created DLL You can download the RibbonX.zip file, which includes the compiled DLL, XML file and the Helpfile. You need to registrate the DLL in order to test it. Please note that the DLL is just a test file.
I would like to take this opportunity to explicit thank John West for his kindness to introduce me to the approach and how we can solved it in a rather easily way.
In my next blogpost I will finally port myself officially to the VSTO 2.5 SE with the Transition case.