Macro works, but doesn't show up in list of macros

Jun 6, 2010 at 10:18 PM

I am just getting started with DNA, and I am running into the following issue. I created a compiled C# dll for Excel DNA. I have no problem with functions, but when I create macros (void methods), they do not show up in the list of available macros (Developer tab > Macros > Macro Name list). On the other hand, if I type in the name of the macro in the list, it gets executed. For instance, typing HelloWorld will show the dialog.

public static void HelloWorld()
   MessageBox.Show("Hello World!");

Am I missing an attribute I should add to the method? I tried [ExcelFunction(IsMacroType = true,Name="MyMacro")], but to no avail.

Any suggestion appreciated!


PS: this is a super interesting project!

Jun 13, 2010 at 12:14 PM

Hi Mathias,

What you see is behaviour of .xll add-in, and not particular to Excel-Dna.

Macros created in .xll add-ins are 'private' and don't show up in that list. I think this is also true for macros in .xla add-ins.

I don't know of any workaround.


Jun 14, 2010 at 8:21 PM

Thanks for the reply Govert. I have actually never written add-ins with xll, only VSTO - my apologies for the very naive question!