Hello,
I use FunctionWizard for some of my UDF functions. The form is opened, i choose parameters. If i press "OK" button in FunctionWizard, everythings goes well - function calculates. But if i press cancel -my UDF formula in cell is not deleted and recieves nullable arguments and then displays error. How can i detect if user choosed "Cancel"?
I've seen addins with UDF functions, when user presses "Cancel" in Function Wizard the cell is cleared.
Here is my code:
dynamic Application = ExcelDnaUtil.Application;
dynamic startCell = Application.ActiveCell;
startCell.FormulaR1C1 = "=PrimeReportUBalance()";
startCell.Select();
startCell.FunctionWizard();
..................
public static string PrimeReportUBalance([ExcelArgument(AllowReference = true, Name = ", Description = "")]
System.DateTime date1,
[ExcelArgument(AllowReference = true, Name = "", Description = "")]
System.DateTime date2,
[ExcelArgument(AllowReference = true, Name = "", Description = "")] object cell = null,
[ExcelArgument(Name = "", Description = ")] bool head = true
.................
if (ExcelDnaUtil.IsInFunctionWizard()==true)
{
return "";
}