--
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.
public static MyRibbon TheRibbon; // allows us to access the Ribbon instance outside this class
internal bool flagMe;public MyRibbon(){
TheRibbon = this;
}
if (MyRibbon.TheRibbon.flagMe)
{
Hi Ken,
You can track the MyRibbon instance by having a 'static' variable somewhere, which you set in the constructor of MyRibbon.
The actual state of the ribbon is not available to read as for a normal forms control - everything works with the callback functions that you put in the xml.You can of course expose your internal values as properties for your other code, and update these from the callback. And even have properties that get set from your other code, which internally invalidates the ribbon, triggering the callback.So the Office ribbon interface is a bit awkward, but you can wrap all of it in your class and exposing friendly interface. (This is exactly what VSTO does too.)
-Govert
How do I get a public reference to the custom Ribbon so that I can access the Ribbon controls from another class in the same C# solution.--
In MyRibbon.cs I have the following constructor. I don't instantiate an actual ribbon from this class since this is done by ExcelDna.So, then how do I get a reference to the ribbon that is created when the XLL loads so I can read the state of controls on the ribbon, like the state of a checkbox control?
[ComVisible(true)]public class MyRibbon : ExcelRibbon{
}
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 exce...@googlegroups.com.