---
Product: Aspose.Cells
Platform: typescript
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/typescript/Worksheet
---

# Worksheet

## Overview

`Worksheet` is a class in Aspose.Cells FOSS for Typescript.

This class provides 24 methods for working with Worksheet objects in Typescript programs.
Available methods include: `addComment`, `addConditionalFormat`, `addDataValidation`, `addHyperlink`, `addImage`, `addShape`, `constructor`, `getCell`, `getCell2`, `getCellByRef`, `getColumnWidth`, `getRowHeight`, and 12 additional methods.
All public members are accessible to any Typescript application after installing the Aspose.Cells FOSS for Typescript package.
Properties: `autoFilter`, `cell`, `cells`, `charts`, `comments`, `conditionalFormats`, and 17 more.

## Description

`Worksheet` is a class in the Aspose.Cells FOSS library for TypeScript that exposes 23 methods and 23 properties for programmatic use.

Core capabilities include: `: string`; `: hyperlink`; `: number`. These operations enable developers to integrate worksheet functionality directly into TypeScript applications.

The class also provides the `cell` property (gets the cell), the `link` property (gets the link), the `startRow` property (gets the start row).

Instances are created through a single constructor that initializes the object with default values.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `cell` | `: string` | Read | Gets the cell. |
| `link` | `: Hyperlink` | Read | Gets the link. |
| `startRow` | `: number` | Read | Gets the start row. |
| `startCol` | `: number` | Read | Gets the start col. |
| `endRow` | `: number` | Read | Gets the end row. |
| `endCol` | `: number` | Read | Gets the end col. |
| `range` | `: string` | Read | Gets the range. |
| `rules` | `: ConditionalFormatRule[]` | Read | Gets the rules. |
| `name` | `string` | Read/Write | Gets the name. |
| `index` | `number` | Read | Gets the index. |
| `cells` | `` | Read | Gets the cells. |
| `value` | `CellValue \| undefined` | Read/Write | Gets the value. |
| `dataValidations` | `` | Read | Gets the data validations. |
| `comments` | `` | Read | Gets the comments. |
| `hyperlinks` | `` | Read | Gets the hyperlinks. |
| `autoFilter` | `` | Read | Gets the auto filter. |
| `conditionalFormats` | `` | Read | Gets the conditional formats. |
| `mergedCells` | `` | Read | Gets the merged cells. |
| `defaultColumnWidth` | `number \| undefined` | Read/Write | Gets the default column width. |
| `defaultRowHeight` | `number \| undefined` | Read/Write | Gets the default row height. |
| `shapes` | `ShapeInfo[]` | Read | Gets the shapes. |
| `charts` | `ChartCollection` | Read | Gets the charts. |
| `images` | `ImageInfo[]` | Read | Gets the images. |

## Methods

| Signature | Description |
|-----------|-------------|
| `constructor(name: string, index: number)` | Creates a new Worksheet with the specified name and zero-based index. |
| `getCell(row: number, col: number)` → `Cell \| undefined` | Returns the Cell at the given zero-based row and column indices, or undefined if the cell does not exist. |
| `getCellByRef(ref: string)` → `Cell \| undefined` | Returns the Cell at the given A1-style reference string, or undefined if the cell does not exist. |
| `getCell2(key: string)` → `Cell` | Returns or creates the Cell identified by the given key string. |
| `putValue(key: string, value: CellValue)` → `Cell` | Writes a value to the cell identified by an A1-style reference and returns the updated Cell instance. |
| `addDataValidation(validation: DataValidation, range: string)` | Attaches data-validation rules to the specified cell range. |
| `addComment(comment: Comment)` | Adds a comment to the worksheet. |
| `addHyperlink(cellRef: string, hyperlink: Hyperlink)` | Adds a hyperlink to the cell at the specified A1-style reference. |
| `setAutoFilter(range: string)` | Sets the auto filter value. |
| `removeAutoFilter()` | Removes the auto filter from the worksheet. |
| `addConditionalFormat(range: string, rules: ConditionalFormatRule[])` | Applies conditional formatting rules to the specified cell range. |
| `mergeCells(range: string)` | Merges the cells in the specified range into a single cell. |
| `unmergeCells(range: string)` | Splits a previously merged range back into individual cells. |
| `setColumnWidth(column: number, width: number)` | Sets the column width value. |
| `getColumnWidth(column: number)` → `number \| undefined` | Returns the width of the specified zero-based column index. |
| `setRowHeight(row: number, height: number)` | Sets the row height value. |
| `getRowHeight(row: number)` → `number \| undefined` | Returns the height of the specified zero-based row index. |
| `setRowHidden(row: number, hidden: boolean)` | Sets the row hidden value. |
| `isRowHidden(row: number)` → `boolean` | Returns true if the specified row is hidden, false otherwise. |
| `setCellStyle(cellRef: string, style: any)` | Sets the cell style value. |
| `addShape(shape: ShapeInfo)` | Adds a shape to the worksheet. |
| `addImage(image: ImageInfo)` | Adds an image to the worksheet. |
| `toXml(drawingIndex: number)` → `string` | Serializes the worksheet drawing to an XML string for the specified drawing index. |
| `getXml(drawingIndex: number)` → `string` | Returns the XML string for the drawing at the specified index. |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)