--
You received this message because you are subscribed to the Google Groups "Excel-Dna" group.
To post to this group, send email to exce...@googlegroups.com.
To unsubscribe from this group, send email to exceldna+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/exceldna?hl=en.
<ExcelCommand(Name:="Recalc")
<ExcelFunction( Name:="Recalc")
--
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.
Visit this group at http://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
Hi,
I don’t think you can register Alt+t, since it’s used by the menu system. Ctrl+t and Alt+b work, though.
You can either set up the shortcut in code, or in an ExcelCommand attribute. I paste some code below.
-Govert
using ExcelDna.Integration;
public class Test : IExcelAddIn
{
public void AutoOpen()
{
// Register Ctrl+t to call SayHello
XlCall.Excel(XlCall.xlcOnKey, "^t", "SayHello");
}
public void AutoClose()
{
// Clear the registration if the add-in is unloaded
XlCall.Excel(XlCall.xlcOnKey, "^t");
}
[ExcelCommand(MenuText = "Say Hello")]
public static void SayHello()
{
XlCall.Excel(XlCall.xlcAlert, "Hello there!");
}
// ShortCut from attribute requires Excel-DNA 0.32
// "%b" means Alt+b
[ExcelCommand(MenuText = "Say Boo", ShortCut="%b")]
public static void SayBoo()
{
XlCall.Excel(XlCall.xlcAlert, "Boo!");
}
}
Hi,