Spread Silverlight Documentation
RemoveCustomFunctions Method (Worksheet)
Example 


The name of the custom function to remove.
Removes the specified user-defined custom function.
Syntax
'Declaration
 
Public Sub RemoveCustomFunctions( _
   ByVal name As System.String _
) 
'Usage
 
Dim instance As Worksheet
Dim name As System.String
 
instance.RemoveCustomFunctions(name)
public void RemoveCustomFunctions( 
   System.string name
)

Parameters

name
The name of the custom function to remove.
Example
This example uses the RemoveCustomFunctions method.
public class CubeFunctionInfo : GrapeCity.CalcEngine.Functions.CalcFunction
        {
            public override string Name { get { return "CUBE"; } }
            public override int MinArgs { get { return 1; } }
            public override int MaxArgs { get { return 1; } }
            public override object Evaluate(object[] args, bool arrayformulamode)
            {
                double num = GrapeCity.CalcEngine.CalcConvert.ToDouble(args[0]);
                return num * num * num;
            }
            public override object Evaluate(object[] args, object context, bool arrayformulamode)
            {
                return Evaluate(args, arrayformulamode);
            }
        }

gcSpreadSheet1.Sheets[0].AddCustomFunction(new CubeFunctionInfo());           
gcSpreadSheet1.Sheets[0].SetFormula(1, 1, "CUBE(4)");

gcSpreadSheet1.Sheets[0].RemoveCustomFunctions("CUBE");
Public Class CubeFunctionInfo
        Inherits GrapeCity.CalcEngine.Functions.CalcFunction
        Public Overrides ReadOnly Property Name() As String
            Get
                Return "CUBE"
            End Get
        End Property
        Public Overrides ReadOnly Property MinArgs() As Integer
            Get
                Return 1
            End Get
        End Property
        Public Overrides ReadOnly Property MaxArgs() As Integer
            Get
                Return 1
            End Get
        End Property
        Public Overrides Function Evaluate(args As Object(), Optional arrayformulamode As Boolean = False) As Object

            Dim num As Double = GrapeCity.CalcEngine.CalcConvert.ToDouble(args(0))
            Return num * num * num
        End Function
        Public Overrides Function Evaluate(args As Object(), context As Object, Optional arrayformulamode As Boolean = False) As Object
            Return Evaluate(args, arrayformulamode)
        End Function
    End Class

GcSpreadSheet1.Sheets(0).AddCustomFunction(New CubeFunctionInfo())
GcSpreadSheet1.Sheets(0).SetFormula(1, 1, "CUBE(4)")

GcSpreadSheet1.Sheets(0).RemoveCustomFunctions("CUBE")
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

Worksheet Class
Worksheet Members

 

 


Copyright © GrapeCity, inc. All rights reserved.