Raphael do Vale
Raphael do Vale

Reputation: 961

Disable excel UDF calculation in "insert function" prompt

Is there any way to disable an excel UDF function (I´m currently using excel DNA library) when it is called by "insert function" prompt?

My Excel UFD function makes webservice calls and this behavior on "insert function" prompt is overloading the server (as each user typing invoke the function).

Does anybody know how to disable this function?

Upvotes: 1

Views: 155

Answers (1)

Govert
Govert

Reputation: 16907

You can detect that your function is being called from the Insert Function dialog by calling ExcelDnaUtil.IsInFunctionWizard(). So you'll have something like:

public static object SlowFunction() 
{ 
    if (ExcelDnaUtil.IsInFunctionWizard()) 
        return "!!! In Function Wizard"; 

    // do the real work otherwise .... 
}

Upvotes: 3

Related Questions