The Office ribbon is quite finicky.
Further, you have to be really careful with the attribute names. E.g. you need to ust getItemID instead of getItemId, else the ribbon won't load.
I paste below a complete .dna file, which contains the ribbon definition and C# callbacks.
You just need to add an ExcelDna.xll copy to see it work.
Please write back if you need any help getting it to work.
<DnaLibrary Name="Ribbon Tests" Language="C#">
<Reference Name="System.Windows.Forms" />
<![CDATA[
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using ExcelDna.Integration;
using ExcelDna.Integration.CustomUI;
// Can make a class that implements ExcelDna.Integration.CustomUI.ExcelRibbon
// to get full Ribbon access.
[ComVisible(true)]
public class MyRibbon : ExcelRibbon
{
public void OnButtonPressed(IRibbonControl control)
{
Console.Beep();
MessageBox.Show("My Button Pressed on control " + control.Id);
}
public int GetItemCount(IRibbonControl control)
{
Console.Beep();
Console.Beep();
return 3;
}
public string GetItemID(IRibbonControl control,int index)
{
return "wB" + index;
}
public string GetItemLabel(IRibbonControl control,int index)
{
string label= "Unknow Workbook";
if (index==1) label= "1 Workbook";
if (index==2) label= "S. Workbook";
if (index==3) label= "A. Workbook";
//_myRibbon.InvalidateControl("cbScenarioWorkbook");
return label;
}
public void SaveChoice(IRibbonControl control, string selectedId, int selectedIndex)
{
MessageBox.Show("My Dropdown Selected on control " + control.Id + " with selection " + selectedId + " at index " + selectedIndex);
}
}
]]>
<CustomUI>
<ribbon>
<tabs>
<tab id='CustomTab' label='My Ribbon Test Tab'>
<group id='SampleGroup' label='My Ribbon Test Group'>
<button id='TestButton'
label='My Test Button'
onAction='OnButtonPressed'/>
<dropDown id='cbScenarioWorkbook'
label='Workbook'
getItemCount='GetItemCount'
getItemID='GetItemID'
getItemLabel='GetItemLabel'
onAction='SaveChoice' />
</group >
</tab>
</tabs>
</ribbon>
</customUI>
</CustomUI>
</DnaLibrary>