Table of Contents

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

int

this[int]

Indexer for the collection

public ExcelNamedRange this[int Index] { get; }

Parameters

Index int

The index

Property Value

ExcelNamedRange

The named range

this[string]

Name indexer

public ExcelNamedRange this[string Name] { get; }

Parameters

Name string

The 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 string

The name

Range ExcelRangeBase

The range

Returns

ExcelNamedRange

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

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