# appendSheet

Source: /xlsx-format/api-reference/functions/appendsheet

Append a worksheet to the end of a workbook's sheet list.

If no name is provided, generates one automatically ("Sheet1", "Sheet2", ...).
When `roll` is true and the name already exists, appends an incrementing
numeric suffix to make it unique (e.g. "Sheet1" -> "Sheet2").

```ts
appendSheet(wb: WorkBook, ws: WorkSheet, name?: string, roll?: boolean): string
```

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| ` wb ` | [` WorkBook `](</xlsx-format/api-reference/interfaces/workbook/>) | Yes | The workbook to add the sheet to |
| ` ws ` | [` WorkSheet `](</xlsx-format/api-reference/interfaces/worksheet/>) | Yes | The worksheet to append |
| ` name ` | ` string ` | No | Optional sheet name; auto-generated if omitted |
| ` roll ` | ` boolean ` | No | If true, auto-increment the name suffix on collision instead of throwing |

## Returns

` string `

The final sheet name that was used
