Hi Chris,
The Excel xlfVolatile fucntion can only be used in macro sheet
equivalent (IsMacroType=true) functions. The following function will
not be volatile, and work as you expect:
[ExcelFunction(IsMacroType=true, IsVolatile=true)]
public static object MyFunc()
{
XlCall.Excel(XlCall.xlfVolatile, false);
return System.DateTime.Now;
}
Note that functions marked a macro-sheet equivalent (IsMacroType=true)
that have arguments allowing range references (AllowReference=true)
are volatile by default even if marked with (IsVolatile=false).
Regards,
Govert