Spread Windows Forms 6.0 Product Documentation
RemoveCustomName Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > ICustomNameSupport Interface : RemoveCustomName Method


name
Name to remove

Glossary Item Box

Removes a user-defined name from the model.

Syntax

Visual Basic (Declaration) 
Sub RemoveCustomName( _
   ByVal name As String _
) 
Visual Basic (Usage)Copy Code
Dim instance As ICustomNameSupport
Dim name As String
 
instance.RemoveCustomName(name)
C# 
void RemoveCustomName( 
   string name
)

Parameters

name
Name to remove

Example

This example removes the specified custom name.
C#Copy Code
FarPoint.Win.Spread.Model.ICustomNameSupport cns;
DialogResult dlg;
cns = (FarPoint.Win.Spread.Model.ICustomNameSupport)fpSpread1.ActiveSheet.Models.Data;
cns.AddCustomName("ALPHA", "SUM(A1,A2)", 1, 1);
cns.AddCustomName("GAMMA", "A1*A2", 2, 2);
fpSpread1.ActiveSheet.SetFormula(1, 1, "ALPHA");
fpSpread1.ActiveSheet.SetFormula(2, 2, "GAMMA");
fpSpread1.ActiveSheet.SetValue(0, 0, 10);
fpSpread1.ActiveSheet.SetValue(1, 0, 10);
dlg = MessageBox.Show("Do you want to remove the custom name?", "RemoveCustomName", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
     cns.RemoveCustomName("ALPHA");
     fpSpread1.ActiveSheet.RecalculateAll();
}
Visual BasicCopy Code
Dim cns As FarPoint.Win.Spread.Model.ICustomNameSupport
Dim dlg As DialogResult
cns = FpSpread1.ActiveSheet.Models.Data
cns.AddCustomName("ALPHA", "SUM(A1,A2)", 1, 1)
cns.AddCustomName("GAMMA", "A1*A2", 2, 2)
FpSpread1.ActiveSheet.SetFormula(1, 1, "ALPHA")
FpSpread1.ActiveSheet.SetFormula(2, 2, "GAMMA")
FpSpread1.ActiveSheet.SetValue(0, 0, 10)
FpSpread1.ActiveSheet.SetValue(1, 0, 10)
dlg = MessageBox.Show("Do you want to remove the custom name?", "RemoveCustomName", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
     cns.RemoveCustomName("ALPHA")
     FpSpread1.ActiveSheet.RecalculateAll()
End If

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.