Excel-DNA is designed to give you full access to the different interface customisation options on all Excel versions. But in particular I wanted to make it possible to make a single add-in that contains both the ribbon customisations for Excel 2007/2010
and a CommandBars fallback for older Excel.
Excel 2007/2010 uses the new ribbon interface. The ribbon interface can be configured with the xml strings and a class that handles the events - there is no simple object model like the older CommandBars. Excel does not support using the CommandBars
COM interfaces to customise the ribbon. For backward compatibility with older versions of Excel, Excel 2007/2010, the older CommandBars are supported by Excel, but all custom CommandBars are placed under an Add-Ins tab on the ribbon. So if you use the
CommandBars API to add menus, you're adding them into that Add-In tab.
Excel-DNA gives you a few different options for doing the CommandBars support:
1. Add it using an Excel-DNA specific .xml format in the .dna file that somewhat mirrors the ribbon xml (why do you say "The <CommandBars> defined in dna file is useless."?)
2. Add it programmatically in your add-in code, from a string that contains the xml info,
3. Add it programmatically in your add-in code, calling the COM CommandBar interfaces, which is compatible with CommandBars customisation you'd have done in VBA.
The main limitation of the Excel-DNA xml string format is that you can't define ComboBox callbacks, but the rest should work fine. Under Excel 2007/2010 all of these will only affect the Add-In tab of the ribbon.
The code snippet you see is just a way to allow future versioning of that CommandBars xml string. The namespace just defines an xml schema, and has nothing to do with the Excel versions supported.
What would you like to do?