Without putting entire ribbon xml, here is my button:
<button id="getLatestCEVersion" keytip="N" label="Download Latest" screentip="Download latest version of this CalcEngine" imageMso="MarkForDownload" onAction="RibbonXOnActionWithTag" tag="GetCurrentCalcEngine" size="large" getEnabled="RibbonXGetEnabled" />
Everything works as expected. If I simply add the getScreentip
attribute like this:
<button id="getLatestCEVersion" keytip="N" label="Download Latest" screentip="Download latest version of this CalcEngine" imageMso="MarkForDownload" onAction="RibbonXOnActionWithTag" tag="GetCurrentCalcEngine" size="large" getEnabled="RibbonXGetEnabled" getScreentip="RibbonXGetScreentip" />
The ribbon onload event is never called (set via <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="RibbonXOnLoad">
) and ribbon is not set and therefore throws exception when I try to invalidate ribbon controls.
public void RibbonXOnLoad( IRibbonUI ribbon )
{
this.ribbon = ribbon;
}
I don't think my code matters for the screen tip handler because it doesn't even get into it, but here it is:
public string RibbonXGetScreentip( IRibbonControl control )
{
switch ( control.Id )
{
case "getLatestCEVersion":
return "Download latest version of this CalcEngine";
case "checkInCalcEngine":
return "Check CalcEngine into Management Site";
case "checkOutCalcEngine":
return "Check CalcEngine out from Management Site";
default: throw new ArgumentOutOfRangeException();
}
}
Does ExcelDna support getScreentip
? Not a lot of info out there, but I have seen a few samples that are supposedly using it, so I think it must be.
Your Ribbon definition becomes invalid when you add the getScreentip
in your example because the screentip
and getScreentip
attributes are mutually exclusive (as per Microsoft's Ribbon XML specification), and they cannot be used together.
i.e. To use getScreentip
, remove the screentip
attribute.