Table of Contents

ExcelFile.GetNamedRange Method

Overloads

ExcelFile.GetNamedRange(Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.Core

public abstract TXlsNamedRange GetNamedRange(Int32 index)

Parameters

<-> Parameter Type Description
index Int32 Index of the named range.

Returns

Named Range

See also

ExcelFile.GetNamedRange(String, Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.Core

public abstract TXlsNamedRange GetNamedRange(String Name, Int32 refersToSheetIndex)

Parameters

<-> Parameter Type Description
Name String Name of the range we are looking for. Case insensitive.
refersToSheetIndex Int32 Sheet where the range refers to. A range with the same name might be defined on more than one sheet.

To get the first range with the name, make refersToSheetIndex<=0
Note that a name can be stored in one sheet and refer to a different sheet. Or it might not refer to any sheet at all. (for example, the name "=name1+1" doesn't refer to any sheet.) And you could have a name "=Sheet1!a1" defined in sheet2. This name will "refer to" sheet1, but be defined in sheet2.

While names are normally all defined globally (sheet 0), if you need to get the names that are stored in a specific sheet, use GetNamedRange(String, Int32, Int32) instead.

Returns

Named Range or null if the range does not exist.

See also

ExcelFile.GetNamedRange(String, Int32, Int32)

Returns the Named Range Definition. If the range is not user defined (like "Print_Area") it will have a one-char name, and the value is on the enum InternalNameRange

Syntax

Namespace: FlexCel.Core

public abstract TXlsNamedRange GetNamedRange(String Name, Int32 refersToSheetIndex, Int32 localSheetIndex)

Parameters

<-> Parameter Type Description
Name String Name of the range we are looking for. Case insensitive.
refersToSheetIndex Int32 Sheet where the range refers to. Note that this is not where the name is stored. Normally names are all stored globally (in sheet 0), but they refer to a specific sheet. For example, if you define the name "=Sheet2!a1" globally, it will be stored in sheet 0, but will refer to sheet2.

A name like "=Sheet1:Sheet2!A1 doesn't refer to any sheet.
localSheetIndex Int32 Sheet where the range is stored. A range might be stored local to a sheet, or global (Excel default).
To get a global range, make localSheetIndex = 0

Returns

Named Range or null if the range does not exist.

See also