Class Worksheet

Represents one worksheet in a Microsoft Excel workbook.

An Excel worksheet is essentially a table with a limited number of rows and columns. To create new worksheet, use [[WorksheetCollection.add]] method of the Workbook.worksheets collection on a Workbook instance.

Hierarchy

Implements

  • IWorkbookProvider
  • IWorksheetShapeOwner
  • ISortSettingsOwner

Constructors

constructor

Properties

$type

$type: Type

Static $t

$t: Type = markType(Worksheet, 'Worksheet', (<any>Sheet).$, [IWorksheetShapeOwner_$type, ISortSettingsOwner_$type])

Static nextHashCode

nextHashCode: number

Accessors

defaultColumnWidth

  • get defaultColumnWidth(): number
  • set defaultColumnWidth(a: number): void
  • Gets or sets the default column width including padding, in 256ths of the '0' digit character width in the workbook's default font.

    The default column width is the width of all columns which do not have their width set.

    The value assigned must be between 0 and 65535. Invalid values will be automatically adjusted to valid values.

    Setting or getting this property is equivalent to calling setDefaultColumnWidth or getDefaultColumnWidth using the WorksheetColumnWidthUnit value of Character256th.

    The default column width including padding, in 256ths of the '0' digit character width in the workbook's default font.
    see

    getDefaultColumnWidth

    see

    setDefaultColumnWidth

    see

    WorksheetColumn.width

    see

    Workbook.characterWidth256thsToPixels

    see

    Workbook.pixelsToCharacterWidth256ths

    Returns number

  • Gets or sets the default column width including padding, in 256ths of the '0' digit character width in the workbook's default font.

    The default column width is the width of all columns which do not have their width set.

    The value assigned must be between 0 and 65535. Invalid values will be automatically adjusted to valid values.

    Setting or getting this property is equivalent to calling setDefaultColumnWidth or getDefaultColumnWidth using the WorksheetColumnWidthUnit value of Character256th.

    The default column width including padding, in 256ths of the '0' digit character width in the workbook's default font.

    Parameters

    • a: number

    Returns void

defaultRowHeight

  • get defaultRowHeight(): number
  • set defaultRowHeight(a: number): void
  • Gets or sets the default row height in twips (1/20th of a point).

    The default row height is the height of all rows which do not have their height explicitly set to a positive number.

    If the assigned value is -1, the default row height will then be calculated based on the default font for the workbook, and subsequently getting this property will return the font-based default row height.

    The default row height in twips (1/20th of a point).
    throws

    [[ArgumentOutOfRangeException]] The value assigned is outside the value range of -1 and 8192.

    Returns number

  • Gets or sets the default row height in twips (1/20th of a point).

    The default row height is the height of all rows which do not have their height explicitly set to a positive number.

    If the assigned value is -1, the default row height will then be calculated based on the default font for the workbook, and subsequently getting this property will return the font-based default row height.

    The default row height in twips (1/20th of a point).

    Parameters

    • a: number

    Returns void

displayOptions

  • Gets the object which controls the display of the worksheet.

    The display options include any settings which affect the display of the worksheet when viewed in Microsoft Excel. These settings will not affect the printed worksheet or the data stored in the worksheet.

    The object which controls the display of the worksheet.
    see

    CustomView.getDisplayOptions

    Returns WorksheetDisplayOptions

filterSettings

  • Exposes methods to identify a region in the worksheet and to apply filters and optionally sort criteria to that region.

    Returns WorksheetFilterSettings

hasProtectionPassword

  • get hasProtectionPassword(): boolean
  • Returns a boolean indicating if the Sheet has been protected with a password.

    When protecting a Sheet, a password is optional. The HasProtectionPassword will return true if the Sheet is currently protected (see isProtected) and a password was specified when it was protected.

    see

    isProtected

    see@see

    [[sheetProtection]]

    see

    Worksheet.protect

    see

    unprotect

    Returns boolean

index

  • get index(): number
  • Gets the zero-based index of this worksheet in its parent Workbook.worksheets collection.

    Negative one indicates the worksheet has been removed from its parent collection.

    The zero-based index of this worksheet in its parent Worksheets collection.
    see

    WorksheetCollection.indexOf

    see

    moveToIndex

    Returns number

isProtected

  • get isProtected(): boolean
  • Returns a boolean indicating if the Worksheet has been protected.

    The IsProtected property will return true if the Worksheet is currently protected. When a Worksheet is protected only unprotected cells may be edited. In addition, other operations may be limited based on the properties of the WorksheetProtection which may be accessed using the Protection property.

    see

    hasProtectionPassword

    see

    [[sheetProtection]]

    see

    WorksheetProtection

    see@see

    Worksheet.protection

    see

    Chartsheet.protection

    see

    unprotect

    Returns boolean

name

  • get name(): string
  • set name(a: string): void
  • Gets or sets the sheet name.

    The sheet name is case-insensitively unique in the workbook.

    The sheet name is shown in the tab for the worksheet. In addition, the worksheet name can be used by formulas from other worksheets to refer to cells in this worksheet.

    The sheet name.
    throws

    [[ArgumentNullException]] The value assigned is null or empty.

    throws

    [[ArgumentException]] The value assigned contains the invalid characters: ':', '', '/', '?', '*', '[', or ']'.

    throws

    [[ArgumentException]] The value assigned exceeds 31 characters in length.

    throws

    [[ArgumentException]] The value assigned is being used as the name of another sheet (sheet names are case-insensitively compared).

    Returns string

  • Gets or sets the sheet name.

    The sheet name is case-insensitively unique in the workbook.

    The sheet name is shown in the tab for the worksheet. In addition, the worksheet name can be used by formulas from other worksheets to refer to cells in this worksheet.

    The sheet name.

    Parameters

    • a: string

    Returns void

printOptions

  • Gets the object which controls how the worksheet prints.

    The print options include any settings which affect the printed appearance of the worksheet. These settings will not affect the data in the worksheet. Although these are not display settings, some worksheet display styles will display all or some of the print options, so these settings may affect the display of the worksheet when viewed in Microsoft Excel.

    The object which controls how the worksheet prints.
    see

    CustomView.getPrintOptions

    Returns PrintOptions

protection

  • Returns an object that provides information used when the Worksheet has been protected.

    see@see@see

    WorksheetProtection

    see

    protect

    see

    Returns WorksheetProtection

selected

  • get selected(): boolean
  • Gets the value which indicates whether this worksheet is selected.

    If the worksheet has been removed from its parent Workbook.worksheets collection, this will always return False.

    The value which indicates whether this worksheet is selected.
    see

    WindowOptions

    see

    Returns boolean

sheetIndex

  • get sheetIndex(): number
  • Gets the zero-based index of this sheet in its parent Workbook.sheets collection.

    Negative one indicates the sheet has been removed from its parent collection.

    The zero-based index of this sheet in its parent Sheets collection.
    see

    SheetCollection.indexOf

    see

    moveToSheetIndex

    Returns number

sortSettings

  • Exposes methods to identify a region in the worksheet and to apply sort criteria to that region.

    Returns WorksheetSortSettings

tabColorInfo

  • Gets or sets the WorkbookColorInfo to use for the associated sheet's tab in the tab bar of Microsoft Excel.

    If the tab bar is not visible, this color will not be seen.

    The WorkbookColorInfo to use for the associated sheet's tab in the tab bar of Microsoft Excel.
    see

    WindowOptions.tabBarVisible

    Returns WorkbookColorInfo

  • Gets or sets the WorkbookColorInfo to use for the associated sheet's tab in the tab bar of Microsoft Excel.

    If the tab bar is not visible, this color will not be seen.

    The WorkbookColorInfo to use for the associated sheet's tab in the tab bar of Microsoft Excel.

    Parameters

    Returns void

type

  • Returns a value indicating the type of sheet

    Returns SheetType

workbook

  • Gets the workbook that owns the worksheet. The Workbook that owns the worksheet.

    Returns Workbook

Methods

_ex

  • Parameters

    • a: number
    • b: number
    • c: boolean

    Returns IEnumerable$1<WorksheetColumn>

clearConditionalFormattingData

  • clearConditionalFormattingData(): void
  • Clears all conditional formatting rules from the Worksheet so they do not get saved. Note: this method is obsolete. Use the Worksheet.ConditionalFormats.Clear() method instead.

    Returns void

columns

  • Gets the column at the specified index.

    Note: Iterating the collection will not create all columns. It will only iterate the columns which have already been used. To create and iterate all columns in the worksheet use a For loop, iterating from 0 to one less than the maximum column count, and pass in each index to the collection's indexer.

    The column at the specified index.
    throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero.

    throws

    [[InvalidOperationException]] 'index' is greater than or equal to Workbook.maxExcelColumnCount or Workbook.maxExcel2007ColumnCount, depending on the Workbook.currentFormat.

    Parameters

    • index: number

      The zero-based index of the column to get.

    Returns WorksheetColumn

  • Gets the collection of columns in the worksheet.

    The collection of columns is a fixed length collection, with the maximum number of columns in the collection being Workbook.maxExcelColumnCount or Workbook.maxExcel2007ColumnCount, depending on the Workbook.CurrentFormat. Internally, the columns are only created and added to the collection when they are requested.

    Note: Iterating the collection will not create all columns. It will only iterate the columns which have already been used. To create and iterate all columns in the worksheet use a For loop, iterating from 0 to one less than the maximum column count, and pass in each index to the collection's indexer.

    The collection of columns in the worksheet.
    see

    WorksheetColumn

    Returns WorksheetColumnCollection

conditionalFormats

dataTables

  • Gets the data table at the specified index in the collection. The data table at the specified index.

    Parameters

    • index: number

      The zero-based index of the data table to get.

    Returns WorksheetDataTable

  • Gets the collection of data tables in the worksheet. The collection of data tables in the worksheet.

    see

    WorksheetDataTable

    Returns WorksheetDataTableCollection

dataValidationRules

  • Gets or sets the references which have the data validation rule applied to it.

    throws

    [[ArgumentNullException]] Occurs when the 'rule' is null.

    throws

    KeyNotFoundException Occurs when the property is retrieved and the 'rule' is not applied to the worksheet.

    throws

    [[ArgumentException]] Occurs when the property is set and the value is from a Worksheet other than this collection.

    throws

    [[ArgumentException]] Occurs when the property is set and the 'rule' is invalid based on its rule type's requirements.

    Parameters

    Returns WorksheetReferenceCollection

  • Gets the collection of data validation rules applied to cells in the Worksheet.

    see

    DataValidationRule

    see

    WorksheetCell.dataValidationRule

    Returns DataValidationRuleCollection

deleteCells

  • deleteCells(region: WorksheetRegion, shiftCellsLeft: boolean): void
  • deleteCells(address: string, shiftCellsLeft: boolean): void
  • Deletes a region of cells.

    throws

    [[InvalidOperationException]] If the operation is not allowed, e.g. if it the range intersects with a protected region.

    throws

    [[ArgumentNullException]] If region is null.

    see

    deleteCells

    see

    insertCells

    see

    insertCells

    Parameters

    • region: WorksheetRegion

      The region to delete

    • shiftCellsLeft: boolean

      If true will shift cells left from the right of the region to occupy the deleted region, otherwise will shift cells up from below the region.

    Returns void

  • Deletes a region of cells.

    throws

    [[InvalidOperationException]] If the operation is not allowed, e.g. if it the range intersects with a protected region.

    throws

    [[ArgumentException]] If address is not valid.

    see

    deleteCells

    see

    insertCells

    see

    insertCells

    Parameters

    • address: string

      The address of the region to delete

    • shiftCellsLeft: boolean

      If true will shift cells left from the right of the region to occupy the deleted region, otherwise will shift cells up from below the region.

    Returns void

equals

  • equals(other: any): boolean
  • Parameters

    • other: any

    Returns boolean

getCell

  • Gets the cell at the specified address or name.

    The Workbook.cellReferenceMode of the workbook will be used to parse the cell address.

    If one or more region references are specified instead of a cell reference, the top-left cell of the first region will be returned.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the workbook's cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address. The overload taking an origin cell must be used to resolve relative R1C1 references.

    see

    Workbook.cellReferenceMode

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the cell.

    Returns WorksheetCell

    A cell represented by the specified address or name.

  • Gets the cell at the specified address or name.

    If one or more region references are specified instead of a cell reference, the top-left cell of the first region will be returned.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    InvalidEnumArgumentException 'cellReferenceMode' is not defined in the CellReferenceMode enumeration.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the specified cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address. The overload taking an origin cell must be used to resolve relative R1C1 references.

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the cell.

    • cellReferenceMode: CellReferenceMode

      The cell reference mode to use to parse the cell address.

    Returns WorksheetCell

    A cell represented by the specified address or name.

  • Gets the cell at the specified address or name.

    If one or more region references are specified instead of a cell reference, the top-left cell of the first region will be returned.

    The origin cell specified will not be used if a name is specified, if the workbook has an A1 cell reference mode, or if an absolute R1C1 address is specified.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    InvalidEnumArgumentException 'cellReferenceMode' is not defined in the CellReferenceMode enumeration.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the specified cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address and 'originCell' is null. An origin cell must be specified to resolve relative R1C1 references.

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the cell.

    • cellReferenceMode: CellReferenceMode

      The cell reference mode to use to parse the cell address.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetCell

    A cell represented by the specified address or name.

  • Gets the cell at the specified address or name.

    The Workbook.cellReferenceMode of the workbook will be used to parse the cell address.

    If one or more region references are specified instead of a cell reference, the top-left cell of the first region will be returned.

    The origin cell specified will not be used if a name is specified, if the workbook has an A1 cell reference mode, or if an absolute R1C1 address is specified.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the workbook's cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address and 'originCell' is null. An origin cell must be specified to resolve relative R1C1 references.

    see

    Workbook.cellReferenceMode

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the cell.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetCell

    A cell represented by the specified address or name.

getCellConditionalFormat

  • Gets the cell conditional format for the cell at the specified row and column index. Note: if the cell is contained in one or more conditional format regions but doesn't match any of thse criteria an instance of CellConditionalFormat will still be returned but its CellConditionalFormat.hasConditionFormatting property will return null. However, if the sell is not contained in any conditional format region then this method will return null.

    throws

    [[ArgumentOutOfRangeException]] 'rowIndex' is less than zero or greater than or equal to the number of rows in the worksheet. 'columnIndex' is less than zero or greater than or equal to the number of columns in the worksheet.

    see

    conditionalFormats

    see

    CellConditionalFormat

    Parameters

    • rowIndex: number

      The 0-based index of the WorksheetRow within the rows collection.

    • columnIndex: number

      The 0-based index of the cell within the WorksheetRow.

    Returns CellConditionalFormat

    The aggregated condition format for the cell at the specified column index or null if the cell is not contained in any conditional format region.

getDefaultColumnWidth

getHashCode

  • getHashCode(): number
  • Returns number

getRegion

  • Gets the region at the specified address or name.

    The Workbook.cellReferenceMode of the workbook will be used to parse the region address.

    If a cell reference is specified instead of a region reference, a 1x1 region containing the cell at the address will be returned.

    If a list of references is specified, the region specified by the first reference will be returned.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the workbook's cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address. The overload taking an origin cell must be used to resolve relative R1C1 references.

    see

    Workbook.cellReferenceMode

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    Returns WorksheetRegion

    A region represented by the specified address or name.

  • Gets the region at the specified address or name.

    If a cell reference is specified instead of a region reference, a 1x1 region containing the cell at the address will be returned.

    If a list of references is specified, the region specified by the first reference will be returned.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    InvalidEnumArgumentException 'cellReferenceMode' is not defined in the CellReferenceMode enumeration.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the specified cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address. The overload taking an origin cell must be used to resolve relative R1C1 references.

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    • cellReferenceMode: CellReferenceMode

      The cell reference mode to use to parse the region address.

    Returns WorksheetRegion

    A region represented by the specified address or name.

  • Gets the region at the specified address or name.

    If a cell reference is specified instead of a region reference, a 1x1 region containing the cell at the address will be returned.

    If a list of references is specified, the region specified by the first reference will be returned.

    The origin cell specified will not be used if a name is specified, if the workbook has an A1 cell reference mode, or if an absolute R1C1 address is specified.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    InvalidEnumArgumentException 'cellReferenceMode' is not defined in the CellReferenceMode enumeration.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the specified cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address and 'originCell' is null. An origin cell must be specified to resolve relative R1C1 references.

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    • cellReferenceMode: CellReferenceMode

      The cell reference mode to use to parse the region address.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetRegion

    A region represented by the specified address or name.

  • Gets the region at the specified address or name.

    The Workbook.cellReferenceMode of the workbook will be used to parse the region address.

    If a cell reference is specified instead of a region reference, a 1x1 region containing the cell at the address will be returned.

    If a list of references is specified, the region specified by the first reference will be returned.

    The origin cell specified will not be used if a name is specified, if the workbook has an A1 cell reference mode, or if an absolute R1C1 address is specified.

    If a name is specified, it must refer to a cell or region in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the workbook's cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address and 'originCell' is null. An origin cell must be specified to resolve relative R1C1 references.

    see

    Workbook.cellReferenceMode

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetRegion

    A region represented by the specified address or name.

getRegions

  • Gets the regions at the specified address or name.

    The Workbook.cellReferenceMode of the workbook will be used to parse the region address.

    The address can be a list of references, each one referring to a separate region on the Worksheet.

    If a cell or single region reference is specified instead, an array of one region at the address will be returned.

    If a name is specified, it must refer to cells or regions in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the workbook's cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address. The overload taking an origin cell must be used to resolve relative R1C1 references.

    see

    Workbook.cellReferenceMode

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    Returns WorksheetRegion[]

    An array of regions represented by the specified address or name.

  • Gets the regions at the specified address or name.

    The address can be a list of references, each one referring to a separate region on the Worksheet.

    If a cell or single region reference is specified instead, an array of one region at the address will be returned.

    If a name is specified, it must refer to cells or regions in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    InvalidEnumArgumentException 'cellReferenceMode' is not defined in the CellReferenceMode enumeration.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the specified cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address. The overload taking an origin cell must be used to resolve relative R1C1 references.

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    • cellReferenceMode: CellReferenceMode

      The cell reference mode to use to parse the region address.

    Returns WorksheetRegion[]

    An array of regions represented by the specified address or name.

  • Gets the regions at the specified address or name.

    The address can be a list of references, each one referring to a separate region on the Worksheet.

    If a cell or single region reference is specified instead, an array of one region at the address will be returned.

    The origin cell specified will not be used if a name is specified, if the workbook has an A1 cell reference mode, or if an absolute R1C1 address is specified.

    If a name is specified, it must refer to cells or regions in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    InvalidEnumArgumentException 'cellReferenceMode' is not defined in the CellReferenceMode enumeration.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the specified cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address and 'originCell' is null. An origin cell must be specified to resolve relative R1C1 references.

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    • cellReferenceMode: CellReferenceMode

      The cell reference mode to use to parse the region address.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetRegion[]

    An array of regions represented by the specified address or name.

  • Gets the regions at the specified address or name.

    The Workbook.cellReferenceMode of the workbook will be used to parse the region address.

    The address can be a list of references, each one referring to a separate region on the Worksheet.

    If a cell or single region reference is specified instead, an array of one region at the address will be returned.

    The origin cell specified will not be used if a name is specified, if the workbook has an A1 cell reference mode, or if an absolute R1C1 address is specified.

    If a name is specified, it must refer to cells or regions in the Worksheet and it must be scoped to the Workbook or the Worksheet or null will be returned.

    throws

    [[ArgumentNullException]] 'address' is null.

    throws

    [[ArgumentException]] 'address' is not a valid name or a valid cell or region address in the workbook's cell reference mode.

    throws

    [[InvalidOperationException]] 'address' is a relative R1C1 address and 'originCell' is null. An origin cell must be specified to resolve relative R1C1 references.

    see

    Workbook.cellReferenceMode

    see

    NamedReference.referencedCell

    see

    NamedReference.referencedRegion

    see

    NamedReference.referencedRegions

    Parameters

    • address: string

      The address or name of the region.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetRegion[]

    An array of regions represented by the specified address or name.

hideColumns

  • hideColumns(startIndex?: number, count?: number): void
  • Hides the columns in the specified range.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'count' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' plus 'count' is greater than the number of columns in the worksheet.

    Parameters

    • Optional startIndex: number

      The index of the first column to hide, or null to start hiding at the first column.

    • Optional count: number

      The number of columns to hide. If null, a single column will be hidden when 'startIndex' is specified and otherwise, all columns will be hidden.

    Returns void

hideRows

  • hideRows(startIndex?: number, count?: number): void
  • Hides the rows in the specified range.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'count' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' plus 'count' is greater than the number of rows in the worksheet.

    Parameters

    • Optional startIndex: number

      The index of the first row to hide, or null to start hiding at the first row.

    • Optional count: number

      The number of rows to hide. If null, a single row will be hidden when 'startIndex' is specified and otherwise, all rows will be hidden.

    Returns void

hyperlinks

  • Gets the hyperlink at the specified index in the collection. The hyperlink at the specified index.

    throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to count.

    Parameters

    • index: number

      The zero-based index of the hyperlink to get.

    Returns WorksheetHyperlink

  • Gets the collection of hyperlinks applied to cells and regions in the Worksheet.

    see

    WorksheetHyperlink

    see

    WorksheetCell.getHyperlink

    see

    WorksheetRow.getCellHyperlink

    Returns WorksheetHyperlinkCollection

insertCells

  • insertCells(region: WorksheetRegion, shiftCellsRight: boolean): void
  • insertCells(address: string, shiftCellsRight: boolean): void
  • Inserts a region of cells.

    throws

    [[InvalidOperationException]] If the operation is not allowed, e.g. if it would cause data to be shifted off the worksheet.

    throws

    [[ArgumentNullException]] If region is null.

    see

    insertCells

    see

    deleteCells

    see

    deleteCells

    Parameters

    • region: WorksheetRegion

      The region to insert

    • shiftCellsRight: boolean

      If true will shift existing cells right to make room for the newly inserted cells, otherwise will shift existing cells down below the region.

    Returns void

  • Inserts a region of cells.

    throws

    [[InvalidOperationException]] If the operation is not allowed, e.g. if it would cause data to be shifted off the worksheet.

    throws

    [[ArgumentException]] If address is not valid.

    see

    insertCells

    see

    deleteCells

    see

    deleteCells

    Parameters

    • address: string

      The region to insert

    • shiftCellsRight: boolean

      If true will shift existing cells right to make room for the newly inserted cells, otherwise will shift existing cells down below the region.

    Returns void

memberwiseClone

  • memberwiseClone(): Base
  • Returns Base

mergedCellsRegions

  • Gets the merged cell region at the specified index. The merged cell region at the specified index.

    throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to count.

    Parameters

    • index: number

      The zero-based index of the merged cell region to get.

    Returns WorksheetMergedCellsRegion

  • Gets the collection of merged cell ranges in this worksheet.

    Use [[WorksheetMergedCellsRegionCollection.add]] method to add new merged cell ranges to the worksheet.

    The collection of merged cell ranges in this worksheet.
    see

    WorksheetMergedCellsRegion

    Returns WorksheetMergedCellsRegionCollection

moveToIndex

  • moveToIndex(index: number): void
  • Moves the worksheet to a new position in the owning workbook's collections of worksheets.

    throws

    [[InvalidOperationException]] The worksheet has previously been removed from its workbook.

    throws

    [[ArgumentOutOfRangeException]] 'index' is less than 0 or greater than or equal to the number of worksheets in the owning workbook.

    see

    Workbook.worksheets

    see

    WorksheetCollection.indexOf

    see

    index

    Parameters

    • index: number

      The new 0-based index to where the worksheet should be moved.

    Returns void

moveToSheetIndex

  • moveToSheetIndex(index: number): void
  • Moves the sheet to a new position in the owning workbook's collections of sheets.

    throws

    [[InvalidOperationException]] The sheet has previously been removed from its workbook.

    throws

    [[ArgumentOutOfRangeException]] 'index' is less than 0 or greater than or equal to the number of sheets in the owning workbook.

    see

    Workbook.sheets

    see

    SheetCollection.indexOf

    see

    sheetIndex

    Parameters

    • index: number

      The new 0-based index to where the sheet should be moved.

    Returns void

protect

  • protect(allowDeletingColumns?: boolean, allowDeletingRows?: boolean, allowEditObjects?: boolean, allowEditScenarios?: boolean, allowFiltering?: boolean, allowFormattingCells?: boolean, allowFormattingColumns?: boolean, allowFormattingRows?: boolean, allowInsertingColumns?: boolean, allowInsertingHyperlinks?: boolean, allowInsertingRows?: boolean, allowSorting?: boolean, allowUsingPivotTables?: boolean): void

rows

  • Gets the row at the specified index.

    Note: Iterating the collection will not create all rows. It will only iterate the rows which have already been used. To create and iterate all rows in the worksheet use a For loop, iterating from 0 to one less than the maximum row count, and pass in each index to the collection's indexer.

    The row at the specified index.
    throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero.

    throws

    [[InvalidOperationException]] 'index' is greater than or equal to Workbook.maxExcelRowCount or Workbook.maxExcel2007RowCount, depending on the Workbook.currentFormat.

    Parameters

    • index: number

      The zero-based index of the row to get.

    Returns WorksheetRow

  • Gets the collection of rows in the worksheet.

    The collection of rows is a fixed length collection, with the maximum number of rows in the collection being Workbook.maxExcelRowCount or Workbook.maxExcel2007RowCount, depending on the Workbook.CurrentFormat. Internally, the rows are only created and added to the collection when they are requested.

    Note: Iterating the collection will not create all rows. It will only iterate the rows which have already been used. To create and iterate all rows in the worksheet use a For loop, iterating from 0 to one less than the maximum row count, and pass in each index to the collection's indexer.

    The collection of rows in the worksheet.
    see

    WorksheetRow

    Returns WorksheetRowCollection

setDefaultColumnWidth

shapes

  • Gets the shape at the specified index in the collection. The shape at the specified index.

    throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to count.

    Parameters

    • index: number

      The zero-based index of the shape to get.

    Returns WorksheetShape

  • Gets the collection of shapes on the worksheet. The collection of shapes on the worksheet.

    see

    WorksheetShape

    Returns WorksheetShapeCollection

sparklineGroups

  • Indexer

    throws

    [[IndexOutOfRangeException]] If the index is negative or greater than or equal to count

    Parameters

    • index: number

      The zer-based index of an item

    Returns SparklineGroup

    The item at the specified index

  • Returns a collection of SparklineGroups (read-only)

    Returns SparklineGroupCollection

tables

  • Gets the WorksheetTable at the specified index. The WorksheetTable at the specified index.

    throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero or 'index' is greater than or equal to count.

    Parameters

    • index: number

      The zero-based index of the WorksheetTable to get.

    Returns WorksheetTable

  • Gets the WorksheetTable with the specified name.

    Worksheet names are compared case-insensitively.

    The WorksheetTable with the specified name.
    throws

    [[InvalidOperationException]] A WorksheetTable with the specified name does not exist in the collection.

    see

    NamedReferenceBase.name

    Parameters

    • name: string

      The name of the WorksheetTable to get.

    Returns WorksheetTable

  • Gets the collection of WorksheetTable instances, or regions formatted as tables, in the worksheet.

    see

    WorksheetTable

    Returns WorksheetTableCollection

unhideColumns

  • unhideColumns(startIndex?: number, count?: number): void
  • Unhides the columns in the specified range.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'count' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' plus 'count' is greater than the number of columns in the worksheet.

    Parameters

    • Optional startIndex: number

      The index of the first column to unhide, or null to start unhiding at the first column.

    • Optional count: number

      The number of columns to unhide. If null, a single column will be unhidden when 'startIndex' is specified and otherwise, all columns will be unhidden.

    Returns void

unhideRows

  • unhideRows(startIndex?: number, count?: number): void
  • Unhides the rows in the specified range.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'count' is less than 0.

    throws

    [[ArgumentException]] Occurs when the 'startIndex' plus 'count' is greater than the number of rows in the worksheet.

    Parameters

    • Optional startIndex: number

      The index of the first row to unhide, or null to start unhiding at the first row.

    • Optional count: number

      The number of rows to unhide. If null, a single row will be unhidden when 'startIndex' is specified and otherwise, all rows will be unhidden.

    Returns void

unprotect

  • unprotect(): void

Static compare

  • compare(item1: any, item2: any): number
  • Parameters

    • item1: any
    • item2: any

    Returns number

Static compareSimple

  • compareSimple(item1: any, item2: any): number
  • Parameters

    • item1: any
    • item2: any

    Returns number

Static equalsSimple

  • equalsSimple(item1: any, item2: any): boolean
  • Parameters

    • item1: any
    • item2: any

    Returns boolean

Static equalsStatic

  • equalsStatic(a: any, b: any): boolean
  • Parameters

    • a: any
    • b: any

    Returns boolean

Static getArrayOfProperties

  • getArrayOfProperties(obj: any): any[]
  • Parameters

    • obj: any

    Returns any[]

Static getArrayOfValues

  • getArrayOfValues(obj: any): any[]
  • Parameters

    • obj: any

    Returns any[]

Static getHashCodeStatic

  • getHashCodeStatic(obj: any): number
  • Parameters

    • obj: any

    Returns number

Static referenceEquals

  • referenceEquals(a: any, b: any): boolean
  • Parameters

    • a: any
    • b: any

    Returns boolean

Static staticInit

  • staticInit(): void
  • Returns void