DefinedNameCollection Class
Collection of defined names that are not directly related with one cell range.
public sealed class DefinedNameCollection : IEnumerable<DefinedName>, IEnumerable
Public NotInheritable Class DefinedNameCollection
Implements IEnumerable(Of DefinedName), IEnumerable
- Inheritance:
- System.ObjectDefinedNameCollection
Properties
Count
Returns the number of defined names in collection.
Property Value
- System.Int32
Item[Int32]
Gets or sets defined name described by index from collection.
public DefinedName this[int index] { get; set; }
Public Property Item(index As Integer) As DefinedName
Parameters
index
- System.Int32
Index of the defined name.
Property Value
Item[String]
Gets defined name described by name from collection.
public DefinedName this[string definedName] { get; }
Public ReadOnly Property Item(definedName As String) As DefinedName
Parameters
definedName
- System.String
Name of the defined name.
Property Value
Methods
AddCopy(DefinedName)
Adds a copy of another defined name to collection and return index of the new defined name.
public int AddCopy(DefinedName source)
Public Function AddCopy(source As DefinedName) As Integer
Parameters
source
- DefinedName
The source defined name.
Returns
- System.Int32
Index of the defined name.
AddDefinedName(String, String, Int32)
Adds defined name to collection and returns index of that defined name.
public int AddDefinedName(string name, string value, int localSheetIndex)
Public Function AddDefinedName(name As String, value As String, localSheetIndex As Integer) As Integer
Parameters
name
- System.String
Name of the defined name.
value
- System.String
Range string.
localSheetIndex
- System.Int32
Local sheet index. If the value is -1, defined name is global.
Returns
- System.Int32
Index of the defined name.
Clear()
Removes all elements from defined names collection.
GetEnumerator()
Returns an System.Collections.Generic.IEnumerator<T> for the collection.
public IEnumerator<DefinedName> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of DefinedName)
Returns
- System.Collections.Generic.IEnumerator<DefinedName>
An System.Collections.Generic.IEnumerator<T> for the collection.
RemoveDefinedName(String)
Removes the defined name described by name from collection.
public void RemoveDefinedName(string definedName)
Public Sub RemoveDefinedName(definedName As String)
Parameters
definedName
- System.String
Name of the defined name.
RemoveDefinedNameAt(Int32)
Removes the defined name described by index from collection.
Parameters
index
- System.Int32
Index of the defined name.