none
Reference a custom Ribbon Add-in RRS feed

  • Question

  • Hello all!

    I've been looking for information about that for several days and I cannot find it. I hope you can help me.

    I had an Excel add-in in my solution in Visual 2003. I could reference it in another project when I need to declare it and call it to create some buttons. Because it buttons will be create using a datatable.

    My code in the other project is:

    OfficeCore.COMAddin addin = excelapp.COMAddIns.Item(ref index);

    IRibbonCustom ribbon = addin.Object as IRibbonCustom;

    ribbon.CreateButtons(datatable);

    I'll try to explain it better. In Excel, I need to have a 'Menu' with some buttons. When you press this menu, the menu is displayed showing several buttons (this buttons insert text in the cell selected). The ribbon (as you can see above) is defined in a custom class.

    It worked fine for Visual Studio 2003 but now I have to do it for 2012 Net 4.0. 

    My first problem is that I need to reference the .dll but I don't know how I can do it in order to do ''ribbon.CreateButtons(datatable);

    Someone could help me?

    Thanks in advance!


    Wednesday, May 29, 2013 2:43 PM

Answers

  • It seems to work fine now but I have to do more tests.

    I've created another project to reference the dll (my customs dll) and I reference this project since the other ones.

    If I get it, I'll write to explain it better.

    Thankis Yuri for answer me!!


    Thursday, May 30, 2013 9:57 AM

All replies

  • hi,

    Ribbon UI is a design time thing, I don't think create button at runtime could work.

    hth


    with regards, Yuri

    Thursday, May 30, 2013 8:55 AM
  • It seems to work fine now but I have to do more tests.

    I've created another project to reference the dll (my customs dll) and I reference this project since the other ones.

    If I get it, I'll write to explain it better.

    Thankis Yuri for answer me!!


    Thursday, May 30, 2013 9:57 AM