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

Hierarchy

Implements

  • IWorksheetShapeOwner
  • ISortSettingsOwner
  • ISheetBackground

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get defaultColumnWidth(): 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.

    See

    • [[getDefaultColumnWidth]]
    • [[setDefaultColumnWidth]]
    • [[WorksheetColumn.width]]
    • [[Workbook.characterWidth256thsToPixels]]
    • [[Workbook.pixelsToCharacterWidth256ths]]

    Returns number

  • set defaultColumnWidth(a): void
  • Parameters

    • a: number

    Returns void

  • get defaultRowHeight(): 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).

    Throws

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

    Returns number

  • set defaultRowHeight(a): void
  • Parameters

    • a: number

    Returns void

  • get displayOptions(): WorksheetDisplayOptions
  • 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

  • get filterSettings(): WorksheetFilterSettings
  • Exposes methods to identify a region in the worksheet and to apply filters and optionally sort criteria to that region.

    Returns WorksheetFilterSettings

  • 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]]
    • [[Worksheet.protect]]
    • [[unprotect]]

    Returns boolean

  • 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]]
    • [[moveToIndex]]

    Returns number

  • 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]]
    • [[sheetProtection]]
    • [[WorksheetProtection]] @see@see [[Worksheet.protection]]
    • [[Chartsheet.protection]]
    • [[unprotect]]

    Returns boolean

  • get name(): 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.

    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

  • set name(a): void
  • Parameters

    • a: string

    Returns void

  • get printOptions(): 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

  • get protection(): WorksheetProtection
  • Returns an object that provides information used when the Worksheet has been protected. @see@see@see [[WorksheetProtection]]

    See

    • [[protect]]

    Returns WorksheetProtection

  • 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]]

    Returns boolean

  • 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]]
    • [[moveToSheetIndex]]

    Returns number

  • get sortSettings(): WorksheetSortSettings
  • Exposes methods to identify a region in the worksheet and to apply sort criteria to that region.

    Returns WorksheetSortSettings

  • get tabColorInfo(): 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.

    See

    [[WindowOptions.tabBarVisible]]

    Returns WorkbookColorInfo

  • set tabColorInfo(a): void
  • Parameters

    Returns void

  • get type(): SheetType
  • Returns a value indicating the type of sheet

    Returns SheetType

  • get workbook(): Workbook
  • Gets the [[workbook]] that owns the worksheet. The Workbook that owns the worksheet.

    Returns Workbook

Methods

  • Parameters

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

    Returns IEnumerable$1<WorksheetColumn>

  • 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

  • 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

  • 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 ConditionBase

  • Returns a collection to which conditions can be added to control the visual attributes of a [[WorksheetCell]] based on user-defined criteria.

    See

    • [[ConditionalFormatCollection]]
    • [[ConditionalFormatCollection.addAverageCondition]]
    • [[ConditionalFormatCollection.addBlanksCondition]]
    • [[ConditionalFormatCollection.addColorScaleCondition]]
    • [[ConditionalFormatCollection.addDataBarCondition]]
    • [[ConditionalFormatCollection.addDateTimeCondition]]
    • [[ConditionalFormatCollection.addDuplicateCondition]]
    • [[ConditionalFormatCollection.addErrorsCondition]]
    • [[ConditionalFormatCollection.addFormulaCondition]]
    • [[ConditionalFormatCollection.addIconSetCondition]]
    • [[ConditionalFormatCollection.addNoBlanksCondition]]
    • [[ConditionalFormatCollection.addNoErrorsCondition]]
    • [[ConditionalFormatCollection.addOperatorCondition]]
    • [[ConditionalFormatCollection.addRankCondition]]
    • [[ConditionalFormatCollection.addTextCondition]]
    • [[ConditionalFormatCollection.addUniqueCondition]]
    • [[ConditionBase]]

    Returns ConditionalFormatCollection

  • 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

  • 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]]
    • [[WorksheetCell.dataValidationRule]]

    Returns DataValidationRuleCollection

  • 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]]
    • [[insertCells]]
    • [[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]]
    • [[insertCells]]
    • [[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

  • Parameters

    • other: any

    Returns boolean

  • 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]]
    • [[NamedReference.referencedCell]]
    • [[NamedReference.referencedRegion]]
    • [[NamedReference.referencedRegions]]

    Parameters

    • address: string

      The address or name of the cell.

    Returns WorksheetCell

  • 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]]
    • [[NamedReference.referencedRegion]]
    • [[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

  • 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]]
    • [[NamedReference.referencedRegion]]
    • [[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

  • 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]]
    • [[NamedReference.referencedCell]]
    • [[NamedReference.referencedRegion]]
    • [[NamedReference.referencedRegions]]

    Parameters

    • address: string

      The address or name of the cell.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetCell

  • 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]]
    • [[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

  • Gets the default column width in the specified units.

    If 'units' is Character256th, the value returned will be the same as the value of the [[defaultColumnWidth]] property.

    Throws

    [[InvalidEnumArgumentException]] 'units' is not defined in the [[WorksheetColumnWidthUnit]] enumeration.

    See

    • [[defaultColumnWidth]]
    • [[setDefaultColumnWidth]]
    • [[WorksheetColumn.getWidth]]

    Parameters

    Returns number

  • Returns number

  • 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]]
    • [[NamedReference.referencedCell]]
    • [[NamedReference.referencedRegion]]
    • [[NamedReference.referencedRegions]]

    Parameters

    • address: string

      The address or name of the region.

    Returns WorksheetRegion

  • 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]]
    • [[NamedReference.referencedRegion]]
    • [[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

  • 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]]
    • [[NamedReference.referencedRegion]]
    • [[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

  • 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]]
    • [[NamedReference.referencedCell]]
    • [[NamedReference.referencedRegion]]
    • [[NamedReference.referencedRegions]]

    Parameters

    • address: string

      The address or name of the region.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetRegion

  • 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]]
    • [[NamedReference.referencedCell]]
    • [[NamedReference.referencedRegion]]
    • [[NamedReference.referencedRegions]]

    Parameters

    • address: string

      The address or name of the region.

    Returns WorksheetRegion[]

  • 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]]
    • [[NamedReference.referencedRegion]]
    • [[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[]

  • 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]]
    • [[NamedReference.referencedRegion]]
    • [[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[]

  • 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]]
    • [[NamedReference.referencedCell]]
    • [[NamedReference.referencedRegion]]
    • [[NamedReference.referencedRegions]]

    Parameters

    • address: string

      The address or name of the region.

    • originCell: WorksheetCell

      The origin for resolving relative R1C1 references.

    Returns WorksheetRegion[]

  • 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

  • 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

  • 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]]
    • [[WorksheetCell.getHyperlink]]
    • [[WorksheetRow.getCellHyperlink]]

    Returns WorksheetHyperlinkCollection

  • 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]]
    • [[deleteCells]]
    • [[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]]
    • [[deleteCells]]
    • [[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

  • Returns Base

  • 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

  • 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]]
    • [[WorksheetCollection.indexOf]]
    • [[index]]

    Parameters

    • index: number

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

    Returns 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]]
    • [[SheetCollection.indexOf]]
    • [[sheetIndex]]

    Parameters

    • index: number

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

    Returns void

  • Protects the worksheet without a password.

    When a Worksheet is protected without a password, the end user may unprotect the Worksheet in Excel without having to supply a password. To programatically unprotect a Worksheet, one may use the Unprotect() method.

    The optional parameters are used to update the property values of the [[WorksheetProtection]] instance from this Worksheet's [[protection]] property. If the parameter is null, the current value of the associated property will be retained; otherwise the property will be updated with the specified value. For example, if the [[WorksheetProtection.allowDeletingColumns]] is currently true and the 'allowDeletingColumns' is null, then the property will continue to be true but if the 'allowDeletingColumns' is false the [[WorksheetProtection.allowDeletingColumns]] will be changed to false.

    When one protects a Worksheet in Excel, the UI allows one to choose which cells may be selected. To affect this state one would change the [[WorksheetProtection.selectionMode]] property before or after protecting the Worksheet.

    Note: If IsProtected is already true, the method will be ignored.

    See

    • [[WorksheetProtection]]

    Parameters

    • Optional allowDeletingColumns: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowDeletingColumns]].

    • Optional allowDeletingRows: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowDeletingRows]].

    • Optional allowEditObjects: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowEditObjects]].

    • Optional allowEditScenarios: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowEditScenarios]].

    • Optional allowFiltering: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowFiltering]].

    • Optional allowFormattingCells: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowFormattingCells]].

    • Optional allowFormattingColumns: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowFormattingColumns]].

    • Optional allowFormattingRows: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowFormattingRows]].

    • Optional allowInsertingColumns: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowInsertingColumns]].

    • Optional allowInsertingHyperlinks: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowInsertingHyperlinks]].

    • Optional allowInsertingRows: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowInsertingRows]].

    • Optional allowSorting: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowSorting]].

    • Optional allowUsingPivotTables: boolean

      Optional boolean indicating the new value for the [[WorksheetProtection.allowUsingPivotTables]]. @see@see@see [[protection]]

    Returns void

  • 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

  • Sets the default column width in the specified units.

    Throws

    [[ArgumentException]] 'value' is infinity or NaN.

    Throws

    [[InvalidEnumArgumentException]] 'units' is not defined in the [[WorksheetColumnWidthUnit]] enumeration.

    See

    • [[defaultColumnWidth]]
    • [[getDefaultColumnWidth]]
    • [[WorksheetColumn.setWidth]]

    Parameters

    • value: number

      The default column width to set on the worksheet, expressed in the specified 'units'.

    • units: WorksheetColumnWidthUnit

      The units in which the 'value' is expressed.

    Returns void

  • 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

  • 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

  • Returns a collection of [[SparklineGroup]]s (read-only)

    Returns SparklineGroupCollection

  • 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

  • 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

  • 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

  • Removes the Sheet protection.

    See

    • [[isProtected]]
    • [[hasProtectionPassword]]
    • [[Worksheet.protect]]

    Returns void

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Returns void