Share via


UdfMethodAttribute.IsVolatile Property

Specifies whether a user-defined function (UDF) method is volatile or non-volatile.

Namespace:  Microsoft.Office.Excel.Server.Udf
Assembly:  Microsoft.Office.Excel.Server.Udf (in Microsoft.Office.Excel.Server.Udf.dll)

Syntax

'Declaration
Public Property IsVolatile As Boolean
    Get
    Set
'Usage
Dim instance As UdfMethodAttribute
Dim value As Boolean

value = instance.IsVolatile

instance.IsVolatile = value
public bool IsVolatile { get; set; }

Property Value

Type: System.Boolean
If false, the UDF is non-volatile; otherwise, true. The default is false.

Remarks

The UdfMethodAttributeattribute has an IsVolatile property. You use the IsVolatile property to specify a UDF method as volatile or non-volatile. The IsVolatile property takes a Boolean value. The default value is false, which means that particular UDF method is non-volatile.

Examples

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Excel.Server.Udf;

namespace UdfWS
{
    [UdfClass]
    public class MyUdfClass
    {
        string textToReturn = "Hello!";

        //This method is declared as volatile.[UdfMethod(IsVolatile = true)]public double MyDouble(double d)
        {
            return d * 9;
        }

        //This method is declared as non-volatile.[UdfMethod]public string MyString()
        {
            return (this.textToReturn);
        }
    }
}

See Also

Reference

UdfMethodAttribute Class

UdfMethodAttribute Members

Microsoft.Office.Excel.Server.Udf Namespace