Show / Hide Table of Contents

Class ExcelNamedRangeCollection

Collection for named ranges

Inheritance
object
ExcelNamedRangeCollection
Implements
IEnumerable<ExcelNamedRange>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelNamedRangeCollection : IEnumerable<ExcelNamedRange>, IEnumerable

Properties

Count

The current number of items in the collection

Declaration
public int Count { get; }
Property Value
Type Description
int

this[int]

Indexer for the collection

Declaration
public ExcelNamedRange this[int Index] { get; }
Parameters
Type Name Description
int Index

The index

Property Value
Type Description
ExcelNamedRange

The named range

this[string]

Name indexer

Declaration
public ExcelNamedRange this[string Name] { get; }
Parameters
Type Name Description
string Name

The name (key) for a Named range

Property Value
Type Description
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

Declaration
public ExcelNamedRange Add(string Name, ExcelRangeBase Range)
Parameters
Type Name Description
string Name

The name

ExcelRangeBase Range

The range

Returns
Type Description
ExcelNamedRange

Add(string, ExcelRangeBase, bool)

Adds a new named range Also see AddFormula(string, string) and AddValue(string, object)

Declaration
public ExcelNamedRange Add(string Name, ExcelRangeBase Range, bool allowRelativeAddress)
Parameters
Type Name Description
string Name

The name

ExcelRangeBase Range

The range

bool allowRelativeAddress

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

Returns
Type Description
ExcelNamedRange

Add(string, object)

Adds a new defined named with a fixed value.

Declaration
public ExcelNamedRange Add(string Name, object Value)
Parameters
Type Name Description
string Name

The name

object Value

The value

Returns
Type Description
ExcelNamedRange

AddFormula(string, string)

Add a defined name referencing a formula

Declaration
public ExcelNamedRange AddFormula(string Name, string Formula)
Parameters
Type Name Description
string Name
string Formula
Returns
Type Description
ExcelNamedRange

AddRange(string, ExcelRangeBase, bool)

Adds a new named range

Declaration
public ExcelNamedRange AddRange(string name, ExcelRangeBase range, bool allowRelativeAddress = false)
Parameters
Type Name Description
string name

The name

ExcelRangeBase range

The range

bool allowRelativeAddress
Returns
Type Description
ExcelNamedRange

AddValue(string, object)

Add a defined name referencing a value

Declaration
public ExcelNamedRange AddValue(string Name, object value)
Parameters
Type Name Description
string Name

The name

object value

The value for the name

Returns
Type Description
ExcelNamedRange

ContainsKey(string)

Checks collection for the presence of a key

Declaration
public bool ContainsKey(string key)
Parameters
Type Name Description
string key

key to search for

Returns
Type Description
bool

true if the key is in the collection

GetEnumerator()

Implement interface method IEnumerator<ExcelNamedRange> GetEnumerator()

Declaration
public IEnumerator<ExcelNamedRange> GetEnumerator()
Returns
Type Description
IEnumerator<ExcelNamedRange>

Remove(string)

Remove a defined name from the collection

Declaration
public void Remove(string Name)
Parameters
Type Name Description
string Name

The name

Implements

IEnumerable<T>
IEnumerable
In this article
Back to top Generated by DocFX