How to update Ribbon UI after logon successful

307 views
Skip to first unread message

John Tran

unread,
Nov 29, 2016, 2:41:06 AM11/29/16
to Excel-DNA
Hi Govert and all,

I have an issue about Ribbon as below:

I have a project which contains both Ribbon and ExcelAddIn. The Ribbon menu (overrides GetCustomUI) display login button. (SampleA.xll)
After login successful. I need load SampleB.xll and add more Ribbon menu group for SampleB.xll addin (get Ribbon xml from method GetRibbonXML in SampleB.xll).
I tried to find solutions to implement it, but they failed.

Can you have solution for this case?

Thank for your helping,
John.

Govert van Drimmelen

unread,
Nov 29, 2016, 3:10:25 PM11/29/16
to exce...@googlegroups.com
Hi John,

This sound reasonable.
I'm not sure what part of the plan you're stuck at.
Loading the other .xll, defining the ribbon, getting both parts onto the same ribbon tab ... ?

-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.

John Tran

unread,
Nov 30, 2016, 2:10:37 AM11/30/16
to Excel-DNA
Yes, I want to append some ribbon group to the current ribbon tab and re-display in UI.
Do you know how to do it? Can I do that by updating ribbon xml then use ribbon.Invalidate?

Govert van Drimmelen

unread,
Nov 30, 2016, 4:13:45 AM11/30/16
to exce...@googlegroups.com

The easiest would be for your SampleB.xll to have its own ExcelRibbon-derived class, which returns the GetCustomUI for its part.

The only issue then is how to write the xml so that they go on the same tab – you use the idMso and idQ attributes for this.

 

If you want a dynamic ribbon in a single add-in, the approach is a bit different. I don’t think you can just Invalidate to get the whole ribbon to reload.

But you can hide tabs and groups, and you can use a dynamicMenu element – see https://msdn.microsoft.com/en-us/library/dd944616(v=office.12).aspx

 

-Govert

Reply all
Reply to author
Forward
0 new messages