Class ExcelNamedRangeCollection
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
Collection for named ranges
public class ExcelNamedRangeCollection : IEnumerable<ExcelNamedRange>, IEnumerable
- Inheritance
-
ExcelNamedRangeCollection
- Implements
- Inherited Members
Properties
Count
The current number of items in the collection
public int Count { get; }
Property Value
this[int]
Indexer for the collection
public ExcelNamedRange this[int Index] { get; }
Parameters
Index
intThe index
Property Value
- ExcelNamedRange
The named range
this[string]
Name indexer
public ExcelNamedRange this[string Name] { get; }
Parameters
Name
stringThe name (key) for a Named range
Property Value
- ExcelNamedRange
a reference to the range
Remarks
Throws a KeyNotFoundException if the key is not in the collection.
Methods
Add(string, ExcelRangeBase)
Adds a new named range
public ExcelNamedRange Add(string Name, ExcelRangeBase Range)
Parameters
Name
stringThe name
Range
ExcelRangeBaseThe range
Returns
Add(string, ExcelRangeBase, bool)
Adds a new named range
public ExcelNamedRange Add(string Name, ExcelRangeBase Range, bool allowRelativeAddress)
Parameters
Name
stringThe name
Range
ExcelRangeBaseThe range
allowRelativeAddress
boolIf true, the address will be retained as it is, if false the address will always be converted to an absolute/fixed address
Returns
AddFormula(string, string)
Add a defined name referencing a formula
public ExcelNamedRange AddFormula(string Name, string Formula)
Parameters
Returns
AddValue(string, object)
Add a defined name referencing value
public ExcelNamedRange AddValue(string Name, object value)
Parameters
Returns
ContainsKey(string)
Checks collection for the presence of a key
public bool ContainsKey(string key)
Parameters
key
stringkey to search for
Returns
- bool
true if the key is in the collection
GetEnumerator()
Implement interface method IEnumerator<ExcelNamedRange> GetEnumerator()
public IEnumerator<ExcelNamedRange> GetEnumerator()
Returns
Remove(string)
Remove a defined name from the collection
public void Remove(string Name)
Parameters
Name
stringThe name