# ExcelWorkbookProtectionOptionsFluent

The fluent methods of ExcelWorkbookProtectionOptions, generated from its public properties: A property-named method sets a property and a singular-named method…

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Modifiers**

static

The fluent methods of [ExcelWorkbookProtectionOptions](/api/excel/officeimo-excel-excelworkbookprotectionoptions/), generated from its public properties: A property-named method sets a property and a singular-named method adds to a collection, both returning the same instance.

## Inheritance

- object
- ExcelWorkbookProtectionOptionsFluent

Filter members 

Show inherited

## Methods

`public static ExcelWorkbookProtectionOptions LegacyPasswordHash(ExcelWorkbookProtectionOptions excelWorkbookProtectionOptions, string? value)` [#](#method-legacypasswordhash-officeimo-excel-excelworkbookprotectionoptions-string)

Sets [ExcelWorkbookProtectionOptions.LegacyPasswordHash](/api/excel/officeimo-excel-excelworkbookprotectionoptions/): Optional precomputed legacy workbook protection hash. When set, this value is written as-is.

Parameters

**excelWorkbookProtectionOptions OfficeIMO.Excel.ExcelWorkbookProtectionOptions required**

The instance.

**value string? required**

The value.

Returns

`ExcelWorkbookProtectionOptions` The same instance.

Examples

```csharp
// C# initializer or property                                                                 // C# fluent
new global::OfficeIMO.Excel.ExcelWorkbookProtectionOptions { LegacyPasswordHash = value };    excelWorkbookProtectionOptions.LegacyPasswordHash(value);
```

`public static ExcelWorkbookProtectionOptions Password(ExcelWorkbookProtectionOptions excelWorkbookProtectionOptions, string? value)` [#](#method-password-officeimo-excel-excelworkbookprotectionoptions-string)

Sets [ExcelWorkbookProtectionOptions.Password](/api/excel/officeimo-excel-excelworkbookprotectionoptions/): Optional workbook protection password. This is Excel UI protection, not package encryption.

Parameters

**excelWorkbookProtectionOptions OfficeIMO.Excel.ExcelWorkbookProtectionOptions required**

The instance.

**value string? required**

The value.

Returns

`ExcelWorkbookProtectionOptions` The same instance.

Examples

```csharp
// C# initializer or property                                                       // C# fluent
new global::OfficeIMO.Excel.ExcelWorkbookProtectionOptions { Password = value };    excelWorkbookProtectionOptions.Password(value);
```

`public static ExcelWorkbookProtectionOptions ProtectStructure(ExcelWorkbookProtectionOptions excelWorkbookProtectionOptions, bool value = true)` [#](#method-protectstructure-officeimo-excel-excelworkbookprotectionoptions-boolean)

Sets [ExcelWorkbookProtectionOptions.ProtectStructure](/api/excel/officeimo-excel-excelworkbookprotectionoptions/): Protects the workbook structure, which prevents sheet add/delete/move/rename operations in Excel UI.

Parameters

**excelWorkbookProtectionOptions OfficeIMO.Excel.ExcelWorkbookProtectionOptions required**

The instance.

**value bool = true optional**

The value; true when omitted.

Returns

`ExcelWorkbookProtectionOptions` The same instance.

Examples

```csharp
// C# initializer or property                                                               // C# fluent
new global::OfficeIMO.Excel.ExcelWorkbookProtectionOptions { ProtectStructure = value };    excelWorkbookProtectionOptions.ProtectStructure(value);
```

`public static ExcelWorkbookProtectionOptions ProtectWindows(ExcelWorkbookProtectionOptions excelWorkbookProtectionOptions, bool value = true)` [#](#method-protectwindows-officeimo-excel-excelworkbookprotectionoptions-boolean)

Sets [ExcelWorkbookProtectionOptions.ProtectWindows](/api/excel/officeimo-excel-excelworkbookprotectionoptions/): Protects workbook windows where supported by the consuming application.

Parameters

**excelWorkbookProtectionOptions OfficeIMO.Excel.ExcelWorkbookProtectionOptions required**

The instance.

**value bool = true optional**

The value; true when omitted.

Returns

`ExcelWorkbookProtectionOptions` The same instance.

Examples

```csharp
// C# initializer or property                                                             // C# fluent
new global::OfficeIMO.Excel.ExcelWorkbookProtectionOptions { ProtectWindows = value };    excelWorkbookProtectionOptions.ProtectWindows(value);
```

## 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?`

<!-- PowerForge markdown artifact sha256:D9FD79E467B4A6AA11BAEFDA1C255E3A7E1D703F0403B5ECF3B967980C2C8C25 -->
