You need to mark the method with [ExcelCommand] instead of [ExcelFunction].
[ExcelCommand(ShortCut = "^D")] // Press Ctrl+Shift+D to run
public static void TestMacro()
{
}
That should clear the registration error. But it still won't who up in the Alt+F8 Macro dialog box - Excel considers macros in .xll add-ins as hidden. However, you can type the name into that dialog, and the "Run" button
should light up and enable you to run the macro.
You can also assign the macro to a shortcut key as above, or a ribbon button when customizing the ribbon (it should appear on the macros list there).
-Govert