Search code examples
c#excelexcel-formulaexcel-dna

Excel DNA function without parameters still shows one parameter in Excel function wizard


Consider function MyFunc without parameters:

[ExcelFunction(Name = "MyFunc", Description = "My func")]
public static object MyFunc()
{
    return "My-Func";
}

Although it has no parameters, when called from Excel using the function wizard there is one parameter listed:

enter image description here

Where is this parameter coming from?

Can it be removed?


Solution

  • This is a long-standing Excel bug. The extra argument box only goes away when you remove the function description completely.

    See also: Register Excel UDF without arguments