Example
The following example defines custom names for a value, a cell, a range of cells, and an expression. The custom name "Alpha" is undefined, and the example returns the value assigned the name "Beta."
C++
CString BetaValue;
// define constant
m_Spread.SetCustomName("Alpha", "5");
// define cell
m_Spread.SetCustomName("Cell", "B1");
// define cell range
m_Spread.SetCustomName("Table", "A1:B1");
// define expression
m_Spread.SetCustomName("Total", "sum(Table)");
// undefine name
m_Spread.SetCustomName("Alpha", NULL);
// return value
BetaValue = GetCustomName("Beta");
Visual Basic
Dim BetaValue As String
' define constant
Dim ret as Boolean
ret = fpSpread1.SetCustomName("Alpha", "5")
' define cell
ret = fpSpread1.SetCustomName("Cell", "B1")
' define cell range
ret = fpSpread1.SetCustomName("Table", "A1:B1")
' define expression
ret = fpSpread1.SetCustomName("Total", "sum(Table)")
' undefine name
ret = fpSpread1.SetCustomName("Alpha", "")
' return value
BetaValue = fpSpread1.GetCustomName("Beta")