# setSheetVisibility

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

Set the visibility state of a worksheet in the workbook.

Initialises the `Workbook.Sheets` metadata array if it does not yet exist.

```ts
setSheetVisibility(wb: WorkBook, sh: number | string, vis: 0 | 1 | 2): void
```

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| ` wb ` | [` WorkBook `](</xlsx-format/api-reference/interfaces/workbook/>) | Yes | The workbook containing the sheet |
| ` sh ` | ` number \| string ` | Yes | Sheet name or zero-based index |
| ` vis ` | ` 0 \| 1 \| 2 ` | Yes | Visibility level: 0 = visible, 1 = hidden, 2 = very hidden |

## Returns

` void `
