# ExcelWorkbookProtectionOptions

Options used when protecting the workbook structure.

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[ExcelCalculationOptions.cs:167](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelCalculationOptions.cs#L167)

**Modifiers**

sealed

Options used when protecting the workbook structure.

## Inheritance

- object
- ExcelWorkbookProtectionOptions

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Protect Sheets and Workbooks](/docs/excel/protection/) Guide
  
  Protect Excel worksheets and workbook structure, and encrypt workbooks with a password to open, using OfficeIMO.Excel and PSWriteOffice.

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Accepted by parameters 1

- Method [ExcelDocument.ProtectWorkbook](/api/excel/officeimo-excel-exceldocument/#method-protectworkbook-officeimo-excel-excelworkbookprotectionoptions) parameter `options`

Filter members 

Show inherited

## Constructors

`public ExcelWorkbookProtectionOptions()` [#](#constructor-ctor)

[ExcelCalculationOptions.cs:167](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelCalculationOptions.cs#L167)

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public bool ProtectStructure { get; set; }` [#](#property-protectstructure)

[ExcelCalculationOptions.cs:167](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelCalculationOptions.cs#L167)

Protects the workbook structure, which prevents sheet add/delete/move/rename operations in Excel UI.

`public bool ProtectWindows { get; set; }` [#](#property-protectwindows)

[ExcelCalculationOptions.cs:172](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelCalculationOptions.cs#L172)

Protects workbook windows where supported by the consuming application.

`public string? Password { get; set; }` [#](#property-password)

[ExcelCalculationOptions.cs:177](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelCalculationOptions.cs#L177)

Optional workbook protection password. This is Excel UI protection, not package encryption.

`public string? LegacyPasswordHash { get; set; }` [#](#property-legacypasswordhash)

[ExcelCalculationOptions.cs:182](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelCalculationOptions.cs#L182)

Optional precomputed legacy workbook protection hash. When set, this value is written as-is.

<!-- PowerForge markdown artifact sha256:326C33EC0BB631233FD6CCCF438987C7612DACCF7A9F4A63FCA0FE8416387BD3 -->
