Hi,
Ah, I see - thanks. I've updated the blog post.
You need something like:
static void RunMacro(string macroName)
{
object xlApp = null;
try
{
xlApp = ExcelDnaUtil.Application;
xlApp.GetType().InvokeMember("Run",
BindingFlags.InvokeMethod, null, xlApp, new object[] {macroName});
}
catch (TargetInvocationException tie)
{
throw tie.InnerException;
}
finally
{
if (xlApp != null) Marshal.ReleaseComObject(xlApp);
}
}
but somehow I got the declaration and the finally out of sync.
The ArrayResizer.dna sample file in the Distribution\Samples directory
of your Excel-DNA distribution should be fine, though.
-Govert