Dear all/Govert,
I am using a ribbon button in ExcelDna. In the XML dna file I have the following:
<button id='ButtonPublish' label='Publish' image='Publish' size='large' onAction='RunTagMacro' tag='Publish' />
This is supposed to publish some value from an excel sheet. All working OK.
However the button is active all the time regardless of whether there is or isn’t any active workbook open.
I would like to update this so that when we open the excel if there is no workbook open, the button will be deactivated.
I have been struggling for the past hour and looked at some links, however I still don’t know how to do that.
I tried to add the GetEnabled callback as following. But then the button becomes disable immediately regardless of any “GetEnabled” function return.
<button id='ButtonPublish' label='Publish' image='Publish' size='large' onAction='RunTagMacro' tag='Publish' getEnabled ='GetEnabled'/>
I would really appreciate if anyone (or Govert) kindly can help with this.
Many thanks,
Zohreh
public class Ribbon : ExcelRibbon { public void GetEnabled(IRibbonControl control) { } }
public class Ribbon : ExcelRibbon { public void GetEnabled(IRibbonControl control) { return true; // or return false; } }