Skip to content

Class ExcelNamedRangeCollection

Namespace: OfficeOpenXml
Assembly: EPPlus.dll

Collection for named ranges

public class ExcelNamedRangeCollection : IEnumerable<ExcelNamedRange>, IEnumerable

Inheritance

object ← ExcelNamedRangeCollection

Implements

IEnumerable
IEnumerable<ExcelNamedRange>

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Properties

Count

The current number of items in the collection

public int Count { get; }

Property Value

int

this[string]

Name indexer

public ExcelNamedRange this[string Name] { get; }

Property Value

ExcelNamedRange

Remarks

Throws a KeyNotFoundException if the key is not in the collection.

this[int]

Indexer for the collection

public ExcelNamedRange this[int Index] { get; }

Property Value

ExcelNamedRange

Methods

Add(string, ExcelRangeBase, bool)

Adds a new named range

public ExcelNamedRange Add(string Name, ExcelRangeBase Range, bool allowRelativeAddress)

Parameters

Name string

The name

Range ExcelRangeBase

The range

allowRelativeAddress bool

If true, the address will be retained as it is, if false the address will always be converted to an absolute/fixed address

Returns

ExcelNamedRange

Add(string, ExcelRangeBase)

Adds a new named range

public ExcelNamedRange Add(string Name, ExcelRangeBase Range)

Parameters

Name string

The name

Range ExcelRangeBase

The range

Returns

ExcelNamedRange

AddFormula(string, string)

Add a defined name referencing a formula

public ExcelNamedRange AddFormula(string Name, string Formula)

Parameters

Name string

Formula string

Returns

ExcelNamedRange

AddValue(string, object)

Add a defined name referencing value

public ExcelNamedRange AddValue(string Name, object value)

Parameters

Name string

The name

value object

The value for the name

Returns

ExcelNamedRange

ContainsKey(string)

Checks collection for the presence of a key

public bool ContainsKey(string key)

Parameters

key string

key 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

IEnumerator<ExcelNamedRange>

Remove(string)

Remove a defined name from the collection

public void Remove(string Name)

Parameters

Name string

The name