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

# CommentCollection

## Overview

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

This class provides 6 methods for working with CommentCollection objects in Typescript programs.
Available methods include: `add`, `clear`, `get`, `getByCell`, `remove`, `toXml`.
All public members are accessible to any Typescript application after installing the Aspose.Cells FOSS for Typescript package.
Properties: `count`.

## Description

`CommentCollection` is a class in the Aspose.Cells FOSS library for TypeScript that exposes 6 methods and 1 property for programmatic use.

Core capabilities include: `number`; removes the comment at the specified index; removes all comments from the collection. These operations enable developers to integrate commentcollection functionality directly into TypeScript applications.

The class also provides the `count` property (gets the count).

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `count` | `number` | Read | Gets the count. |

## Methods

| Signature | Description |
|-----------|-------------|
| `add(row: number, col: number, text: string, author: string)` → `Comment` | Creates a new comment at the specified cell position and adds it to the collection. |
| `get(index: number)` → `Comment \| undefined` | Returns the comment at the given index, or undefined if not found. |
| `getByCell(row: number, col: number)` → `Comment \| undefined` | Returns the comment at the specified cell position, or undefined if not found. |
| `remove(index: number)` | Removes the comment at the specified index. |
| `clear()` | Removes all comments from the collection. |
| `toXml()` → `string` | Serializes the comment collection to an XML string. |

## See Also

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