Reputation: 961
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
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