Table of Contents

TXlsNamedRange Record

An Excel named range.

Syntax

Unit: FlexCel.Core

TXlsNamedRange = record;

Fields

Name Description
Bottom Bottom of the range.
Comment Returns the comment associated with the name, if there is one. Comments are only available in Excel 2007, but they are saved too in xls file format.
Left Left of the range.
Name The name of the range.
NameSheetIndex The sheet index for the name (1 based). A named range can have the same name than other as long as they are on different sheets. The default value(0) means a global named range, not tied to any specific sheet.
OptionFlags Options of the range. You can access the options by using the corresponding properties. (Hidden, BuiltIn, etc).

You can use this property to set them all at the same time.

You can get the properties by OR'ing the following values:

01. Name is hidden. Corresponds to the property Hidden.

02. Name is a function. Corresponds to the property FunctionDef.

04. Name is a VB procedure. If set you also need to set 08 (name is a macro). Corresponds to the property...[more]
RangeFormula This is a formula defining the range. It can be used to define complex ranges.
For example you can use "=​Sheet1!​$A:​$B,​Sheet1!​$1:​$2"​.​
When this parameter is set, SheetIndex, Left, Top, Right and Bottom properties have no meaning.

Note that with relative references, we always consider "A1" to be the cell where the name is. This means that the formula: "=$A$1 + A1" when evaluated in Cell B8, will read "=$A$1 + B8". To provide a negative offset, you need to wrap the formula.
For example "=A1048575" will evaluate to B7 when evaluated in B8.
Right Right of the range.
SheetIndex The Sheet index where the row and col properties apply. 1-based. When RangeFormula is set, it is not used.
Top Top of the range.

Methods

Name Description
Create Overloaded
Create
Create(string, Integer, Integer, string)
Create(string, Integer, Integer, Integer, Integer, Integer, Integer, string)
Create(string, Integer, Integer, Integer, Integer, Integer, Integer, Integer)
Create(string, Integer, Integer, Integer, Integer, Integer, Integer, Integer, string)
Create(string, Integer, Integer, Integer, Integer, Integer, Integer, Integer, string, string)
Equals Returns true if both objects are equal.
GetHashCode Returns the hashcode of the object.
GetInternalName Returns the string that corresponds to an internal name.
GetRanges Overloaded
GetRanges(TCoreExcelFile)
GetRanges(TCoreExcelFile, Integer)
HasValue Returns true if the record has a defined value. This is the inverse of IsNull
IsNull Returns true if the record doesn't have a defined value.
IsValidRangeName Returns true if the string is a valid name for a named range. Valid names must start with a letter or an underscore
Null Creates an invalid Cell range with all coordinates being negative.
ToString A human-readable representation of the range.

Operators

Name Description
Equality Adapts the = operator so it returns true when both instances have the same values.
Explicit Conversion Converts from TXlsNamedRange instances to TXlsCellRange instances when you do an explicit cast.
Inequality Adapts the <> operator so it returns true when both instances have different values.

Properties

Name Description
BuiltIn True if the range is a built in name. Built in names are 1 char long.
CalcExp True if the range contains a complex function.
CellRef Gets or sets the string that defines the 2D-range in A1 notation.
FunctionDef True if the range is a function.
FunctionGroup Specifies the function group index if the defined name refers to a function. The function group defines the general category for the function. This attribute is used when there is an add-in or other code project associated with the file.
Hidden True if the range is hidden.
Proc True if the range is a function on a macro sheet.
PublishToServer Indicates whether the defined name is included in the version of the workbook that is published to or rendered on a Web or application server. This is new to Excel 2007.
VisualBasicProc True if the range is a Visual Basic Procedure
WorkbookParameter indicates that the name is used as a workbook parameter on a version of the workbook that is published to or rendered on a Web or application server. This is new to Excel 2007.