Activates the worksheet bringing it in to focus (equivalent to clicking the sheet's tab in Excel).
Activating a worksheet deactivates the currently activated worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Adds a listener for the specified worksheet event.
Type of the worksheet event to listen for.
Function called when the specified event occurs.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
EventError if specified event is not supported.
Adds a listener that is called when the worksheet is activated.
Name of the event fired when the worksheet is activated.
Function called when the specified event occurs.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Adds a listener that is called when when cells in the worksheet are changed by the user or by an external link (but not during a recalculation).
Name of the event fired when the worksheet is changed.
Function called when the specified event occurs.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Adds a listener that is called when the worksheet is deactivated (i.e. another worksheet is activated).
Name of the event fired when the worksheet is deactivated.
Function called when the specified event occurs.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Triggers calculation for the worksheet.
Only necessary when automatic calculation is turned off.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Clears formatting for all of the cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Clears values for all of the cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Clears values and formatting for all of the cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines one or more cells in the worksheet. Multiple cell ranges can be provided separated by commas (e.g. A1,B2:C3
).
Get a CellRange, then call the clearFormatting function instead.
Clears formatting for a range of cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines one or more cells in the worksheet. Multiple cell ranges can be provided separated by commas (e.g. A1,B2:C3
).
Get a CellRange, then call the clearValues function instead.
Clears values for a range of cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines one or more cells in the worksheet. Multiple cell ranges can be provided separated by commas (e.g. A1,B2:C3
).
Get a CellRange, then call the clear function instead.
Clears values and formatting for a range of cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines the cells that the data stream will be output to.
Function that is run after every interval, returns the value that the cellRange
will be updated with.
Optional
updateInterval: numberThe time (in milliseconds) between updates (defaults to 1 second).
The data stream object enabling control of the stream.
Get a CellRange, then call the createDataStream function instead.
Creates a data stream that updates the value(s) of a cell range at a given interval.
ApiError if an exception is thrown when registering the data stream.
Deletes the worksheet.
After calling this function do not attempt to use this worksheet again. Doing so will likely result in an AdapterError since the underlying object/file is no longer available.
Attempting to delete the only worksheet in a workbook will result in an AdapterError being thrown.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines the cells or column headers that the filter will be applied to.
The column on which the filter will be applied (1
being the left-most column in the range).
The type of operator to apply to the filter.
Optional
criteria1: stringThe first criteria to apply.
Optional
criteria2: stringThe second criteria to apply (use with criteria1
and filterOperator
to construct compound criteria).
Optional
visibleDropDown: booleanDetermines whether to display the drop down icon against the filtered column (defaults to true
).
Get a CellRange, then call the setFilter function instead.
Filters a table of cells in the worksheet.
The cellRange
should define the table headers, and 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
).AdapterError if filter parameters have been incorrectly specified, or if an exception is thrown by the adapter process, typically by the Excel PIA.
Gets a range of cells in the worksheet.
A1-style reference to a range of cells in the worksheet. It can include the range operator (a colon), the intersection operator (a space), or the union operator (a comma). It can also include dollar signs and you can use a local defined name in any part of the range (e.g. A1,B2:C3,myNamedRange
).
A cell range for the given address.
InvalidCellRangeAddressError if the provided cell range address is invalid.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines one or more cells in the worksheet. Multiple cell ranges can be provided separated by commas (e.g. A1,B2:C3
).
The cells defined by the range.
Get a CellRange, then call the getCells function instead.
Gets a range of cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Gets the worksheet name.
The worksheet name.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Protects the worksheet so that it cannot be modified.
AdapterError if the requested property is not a supported type, or if an exception is thrown by the adapter process, typically by the Excel PIA.
Removes a previously added listener for the specified worksheet event.
Function that was provided as the listener when addEventListener
was called.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
EventError if provided listener
function does not match any added event listener.
Any valid cell notation (addresses, names, etc) that defines one or more cells in the worksheet. Multiple cell ranges can be provided separated by commas (e.g. A1,B2:C3
).
An object that defines the formatting options to set on the cells.
Get a CellRange, then call the setFormatting function instead.
Sets the formatting for a range of cells in the worksheet.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines one or more cells in the worksheet. Multiple cell ranges can be provided separated by commas (e.g. A1,B2:C3
).
The name to assign to the cell range.
Get a CellRange, then call the setName function instead.
Assigns a name to a range of cells in the worksheet 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.
ParameterError if an invalid name value is provided.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Any valid cell notation (addresses, names, etc) that defines one or more cells in the worksheet. The first cell in the range will be used as the starting point for the update.
A two-dimensional array where the outer array defines the number of rows, and the inner arrays define the values for each column (cell).
Get a CellRange, then call the setValues function instead.
Sets the values for a range of cells in the worksheet.
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 provided cell range determines the starting point for the update (i.e. the first cell in the range).
If only a single value is provided in the values map then the entire provided cell range will be updated with this value.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Sets the worksheet name.
Worksheet names must be less than 32 chars long and cannot contain the following characters: , /, ?, *, [ or ]. For convenience, this function automatically cleans the supplied name by removing invalid characters and trims to max length.
If your code uses the worksheet name after updating, be sure to call getName first to ensure the correct value is used.
ParameterError if an invalid name value is provided.
AdapterError if an exception is thrown by the adapter process, typically by the Excel PIA.
Generated using TypeDoc
An object that represents a worksheet in an open workbook in Excel.