ig.excel.NamedReference

Represents a named reference defined in the workbook.

Remarks

Named references allow for names to be used in formulas instead of complex formulas or cell references. For example, instead of using the formula =SUM(E1:E20), a named reference with a name of 'Sales' can be defined to point to the range of E1:E20 (the named reference's formula would be defined like this: =Sheet1!$E$1:$E$20). Then the original formula could be expressed as =SUM(Sales).

Each named reference has an associated scope, which can either be the NamedReference.workbook to which the named reference belongs or one of the Worksheet instances in the Workbook. The scope determines how the name must be referenced in formulas for different cells. A scope of the workbook means the named reference must be accessed by a formula in any cell of the workbook by specifying only the name. A scope of the worksheet means formulas used in other worksheets must reference the name by first specifying the worksheet scope, such as =SUM( Sheet2!Sales ). If the formula is in the same worksheet as the scope of the named reference, the formula can reference the name with or without the worksheet name.

Named references from external workbooks must always be referenced with the scope first. If the named reference's scope is the external workbook, the name is accessed by specifying the workbook file name followed by the name, such as in the following formula: ='C:\ExternalWorkbook.xls'!SalesTax. If the named reference has a scope of a worksheet in the workbook, it is referenced by specifying the file name, worksheet, and name: ='C:\[ExternalWorkbook.xls]Sheet1'!SalesTax.

Named references with different scopes can have the same names, but if two named references have the same scope, they must have case-insensitively unique names.

Dependencies

jquery-1.4.4.js
infragistics.util.js
infragistics.ext_collections.js
infragistics.ext_collectionsExtended.js
infragistics.ext_io.js
infragistics.ext_text.js
infragistics.ext_core.js
infragistics.documents.core_core.js
infragistics.ext_ui.js
The current widget has no options.
The current widget has no events.
  • formula

    .formula( );
    Return Type:
    string
    Return Type Description:
    The formula which defines the named reference.

    Gets the formula which defines the named reference.

  • isSimpleReferenceFormula

    .isSimpleReferenceFormula( );

    Gets the value indicating whether the NamedReference.formula is a simple formula referring to a single cell, a single region, or multiple regions in the same workbook as the named reference.

    Remarks

    If the reference is surrounded by parentheses or whitespace or the named reference has some other complex formula this will return false.

  • referencedCell

    .referencedCell( );
    Return Type:
    ig.excel.WorksheetCell
    Return Type Description:
    Returns a WorksheetCell.

    Gets the WorksheetCell referenced by the NamedReference.formula.

    Remarks

    If named reference is a reference to one or more regions, this will return null.

  • referencedRegion

    .referencedRegion( );
    Return Type:
    ig.excel.WorksheetRegion
    Return Type Description:
    Returns a WorksheetRegion.

    Gets the WorksheetRegion referenced by the NamedReference.formula.

    Remarks

    If the named reference is a reference to a single cell or multiple regions, this will return null.

  • referencedRegions

    .referencedRegions( );

    Gets the array of WorksheetRegion instances referenced by the NamedReference.formula.

    Remarks

    If the named reference is a reference to a single cell or region, this will return null.

  • setFormula

    .setFormula( formula:string );

    Sets the formula for a named reference.

    • formula
    • Type:string
    • The string containing the formula value.

    Exceptions

    Exception Description
    ig.ArgumentNullException formula is null or empty.
    ig.ArgumentException formula is not a valid formula. The inner exception will contain the FormulaParseException describing the reason the formula was not valid.

    Remarks

    The formula will be parsed using the CellReferenceMode of the NamedReference.workbook to which the NamedReference is applied. If the NamedReference has been removed from its collection, the A1 reference mode will be used to parse the formula.

  • setFormula

    .setFormula( formula:string, cellReferenceMode:ig.excel.CellReferenceMode );

    Sets the formula for a named reference.

    • formula
    • Type:string
    • The string containing the formula value.
    • cellReferenceMode
    • Type:ig.excel.CellReferenceMode
    • The mode used to interpret cell references in the formula.

    Exceptions

    Exception Description
    ig.ArgumentNullException formula is null or empty.
    ig.excel.InvalidEnumArgumentException cellReferenceMode is not defined in the CellReferenceMode enumeration.
    ig.ArgumentException formula is not a valid formula. The inner exception will contain the FormulaParseException describing the reason the formula was not valid.
  • setFormula

    .setFormula( formula:string, cellReferenceMode:ig.excel.CellReferenceMode, culture:string );

    Sets the formula for a named reference.

    • formula
    • Type:string
    • The string containing the formula value.
    • cellReferenceMode
    • Type:ig.excel.CellReferenceMode
    • The mode used to interpret cell references in the formula.
    • culture
    • Type:string
    • The culture used to parse the formula.

    Exceptions

    Exception Description
    ig.ArgumentNullException formula is null or empty.
    ig.excel.InvalidEnumArgumentException cellReferenceMode is not defined in the CellReferenceMode enumeration.
    ig.ArgumentException formula is not a valid formula. The inner exception will contain the FormulaParseException describing the reason the formula was not valid.
  • toString

    .toString( );
    Return Type:
    string
    Return Type Description:
    The string representation of the named reference.

    Gets the string representation of the named reference.

Copyright © 1996 - 2019 Infragistics, Inc. All rights reserved.