AboutSupportDeveloper GuideVersion 1.5.0

An object that represents a cell range in a worksheet in Excel.

Hierarchy

  • CellRange

Properties

address: string

The address of the cell range.

Methods

  • Adds a listener for the specified cell range event.

    Parameters

    • eventName: string

      Type of the cell range event to listen for.

    • listener: CellRangeEventListener

      Function called when the specified event occurs.

    Returns Promise<void>

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

    Throws

    EventError if specified event is not supported.

  • Adds a listener that is called when when a cell in the range is changed by the user or by an external link (but not during a recalculation).

    Parameters

    • eventName: "change"

      Name of the event fired when a cell in the range is changed.

    • listener: CellRangeChangedEventListener

      Function called when the specified event occurs.

    Returns Promise<void>

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Clears values and formatting for all cells in the range.

    Returns Promise<void>

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Clears formatting for all cells in the range.

    Returns Promise<void>

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Clears values for all cells in the range.

    Returns Promise<void>

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Creates a data stream that updates the values of all cells in the range at a given interval.

    Parameters

    • repeater: (() => Promise<CellValue>)

      Function that is run after every interval, returns the value that the cells in the range will be updated with.

    • Optional updateInterval: number

      The time (in milliseconds) between updates (defaults to 1 second).

    Returns DataStream

    The data stream object enabling control of the stream.

    Throws

    ApiError if an exception is thrown when registering the data stream.

  • Gets all cells in the range.

    Returns Promise<Cell[]>

    An array of the cells that are in the range.

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Gets the list of names for the range.

    Returns Promise<string[]>

    The names associated with the cell range.

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Parameters

    Returns Promise<void>

  • Filters a table of cells in the worksheet.

    The range should include only the table headers, columnIndex will determine which column to apply the filter to (1 being the left-most column in the range).

    Set filterOperator to And and Or with criteria1 and criteria2 to construct compound criteria. When using only a single criteria, filterOperator should be set to Or otherwise the filter may not display the expected results. When setting criteria use simple logic rules e.g. >100, <=50000, =Account1, <>Account2.

    Alternatively use the other filter operators for predefined criteria:

    • Top10Items/Bottom10Items: Highest/lowest valued items displayed (specify number of items in criteria1).
    • Top10Percent/Bottom10Percent: Highest/lowest valued items displayed (specify percentage in criteria1).
    • FilterValues: Display cells that have a specific value (specify value in criteria1).

    Parameters

    • columnIndex: number

      The column on which the filter will be applied (1 being the left-most column in the range).

    • filterOperator: ExcelFilterOperator

      The type of operator to apply to the filter.

    • Optional criteria1: string

      The first criteria to apply.

    • Optional criteria2: string

      The second criteria to apply (use with criteria1 and filterOperator to construct compound criteria).

    • Optional visibleDropDown: boolean

      Determines whether to display the drop down icon against the filtered column (defaults to true).

    Returns Promise<void>

    Throws

    AdapterError if filter parameters have been incorrectly specified, or if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Sets the formatting for all cells in the range.

    Parameters

    • formatting: CellFormatting

      An object that defines the formatting options to set on the cells.

    Returns Promise<void>

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Assigns a name to the range which can then be used to specify the same range in other functions.

    Adding a name does not remove any other names that have already been set for the specified range.

    Parameters

    • newName: string

      The name to assign to the range.

    Returns Promise<void>

    Throws

    ParameterError if an invalid name value is provided.

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

  • Sets the values for all cells in the range.

    The function takes a values map which is a two-dimensional array where the outer array defines the number of rows, and the inner arrays define the values for each column (cell). The starting point for the update will be the first cell in the range.

    If only a single value is provided in the values map then all cells in the range will be updated with this value.

    Parameters

    • valuesMap: CellValue[][]

      A two-dimensional array where the outer array defines the number of rows, and the inner arrays define the values for each column (cell).

    Returns Promise<void>

    Throws

    AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.

Generated using TypeDoc