> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Other classes: Comments and protection

## `AllowEditRange`

`Excel.AllowEditRange`: one `<protectedRange>`; the title is its key.

Import from `@reductoai/xlsx/officejs`.

### AllowEditRange properties

| Name | Type | Description |
| - | - | - |
| `address` | `string` | The areas, comma separated, without the sheet name. |
| `isPasswordProtected` | `boolean` | read-only |
| `isPaused` | `boolean` | read-only Whether `pauseProtection` holds for this session (an extension; Office.js has no reader). |
| `title` | `string` | |

### `AllowEditRange.delete()`

```ts theme={null}
delete(): void
```

### `AllowEditRange.pauseProtection()`

```ts theme={null}
pauseProtection(password?: string): void
```

Lets this range be edited for the session; the file keeps the protection.

### `AllowEditRange.set()`

```ts theme={null}
set(
  properties: AllowEditRange | { address?: string; title?: string },
  options?: UpdateOptions,
): void
```

### `AllowEditRange.setPassword()`

```ts theme={null}
setPassword(password?: string): void
```

An empty or missing password removes it.

## `AllowEditRangeCollection`

`Excel.AllowEditRangeCollection`: the sheet's `<protectedRanges>`.

Import from `@reductoai/xlsx/officejs`.

### AllowEditRangeCollection properties

| Name | Type | Description |
| - | - | - |
| `items` | `AllowEditRange[]` | read-only |

### `AllowEditRangeCollection.add()`

```ts theme={null}
add(title: string, rangeAddress: string, options?: AllowEditRangeOptions): void
```

### `AllowEditRangeCollection.getCount()`

```ts theme={null}
getCount(): ClientResult<number>
```

### `AllowEditRangeCollection.getItem()`

```ts theme={null}
getItem(key: string): AllowEditRange
```

### `AllowEditRangeCollection.getItemAt()`

```ts theme={null}
getItemAt(index: number): AllowEditRange
```

### `AllowEditRangeCollection.getItemOrNullObject()`

```ts theme={null}
getItemOrNullObject(key: string): AllowEditRange & { isNullObject: boolean }
```

### `AllowEditRangeCollection.pauseProtection()`

```ts theme={null}
pauseProtection(password: string): void
```

Pauses every range with this password; throws when none has it.

## `ExcelCommentReplyCollection`

`Excel.CommentReplyCollection` of one comment.

Import from `@reductoai/xlsx/officejs`.

### ExcelCommentReplyCollection properties

| Name | Type | Description |
| - | - | - |
| `items` | `ExcelCommentReply[]` | read-only |

### `ExcelCommentReplyCollection.add()`

```ts theme={null}
add(content: string | CommentRichContent, contentType?: ContentType): ExcelCommentReply
```

### `ExcelCommentReplyCollection.getCount()`

```ts theme={null}
getCount(): { value: number }
```

### `ExcelCommentReplyCollection.getItem()`

```ts theme={null}
getItem(commentReplyId: string): ExcelCommentReply
```

### `ExcelCommentReplyCollection.getItemAt()`

```ts theme={null}
getItemAt(index: number): ExcelCommentReply
```

### `ExcelCommentReplyCollection.getItemOrNullObject()`

```ts theme={null}
getItemOrNullObject(
  commentReplyId: string,
): ExcelCommentReply & { isNullObject: boolean }
```

## `WorkbookProtection`

`Excel.WorkbookProtection`: `<workbookProtection lockStructure>`.

Import from `@reductoai/xlsx/officejs`.

### WorkbookProtection properties

| Name | Type | Description |
| - | - | - |
| `isPasswordProtected` | `boolean` | read-only Whether a password guards Unprotect (an extension; Office.js has no reader). |
| `protected` | `boolean` | read-only |

### `WorkbookProtection.protect()`

```ts theme={null}
protect(password?: string): void
```

Locks the sheet structure; throws when it is already locked.

### `WorkbookProtection.unprotect()`

```ts theme={null}
unprotect(password?: string): void
```
