# ExcelDocumentFluent

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

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Modifiers**

static

The fluent methods of [ExcelDocument](/api/excel/officeimo-excel-exceldocument/), 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
- ExcelDocumentFluent

Filter members 

Show inherited

## Methods

ActiveWorksheet``1 4 overloads

`public static TSelf ActiveWorksheet<TSelf>(TSelf excelDocument, string sheetName)` [#](#method-activeworksheet-string)

Sets the worksheet that spreadsheet applications should show when the workbook opens.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**sheetName string required**

Worksheet name.

Returns

`TSelf` The same instance.

`public static TSelf ActiveWorksheet<TSelf>(TSelf excelDocument, int sheetIndex)` [#](#method-activeworksheet-int32)

Sets the worksheet that spreadsheet applications should show when the workbook opens.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**sheetIndex int required**

Zero-based worksheet index.

Returns

`TSelf` The same instance.

`public static TSelf ActiveWorksheet<TSelf>(TSelf excelDocument, ExcelSheet sheet)` [#](#method-activeworksheet-officeimo-excel-excelsheet)

Sets the worksheet that spreadsheet applications should show when the workbook opens.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**sheet OfficeIMO.Excel.ExcelSheet required**

Worksheet to activate.

Returns

`TSelf` The same instance.

`public static TSelf ActiveWorksheet<TSelf>(TSelf excelDocument, Action<ExcelSheet> configure)` [#](#method-activeworksheet-action-officeimo-excel-excelsheet)

Configures [ExcelDocument.ActiveWorksheet](/api/excel/officeimo-excel-exceldocument/) in place: Gets the worksheet that spreadsheet applications show when the workbook opens, or null when the active tab is not a worksheet.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**configure System.Action<OfficeIMO.Excel.ExcelSheet> required**

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf ApplicationProperties<TSelf>(TSelf excelDocument, Action<ExcelApplicationProperties> configure)` [#](#method-applicationproperties-action-officeimo-excel-excelapplicationproperties)

Configures [ExcelDocument.ApplicationProperties](/api/excel/officeimo-excel-exceldocument/) in place: Extended (application) properties (Company, Manager, etc.).

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**configure System.Action<OfficeIMO.Excel.ExcelApplicationProperties> required**

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf Calculation<TSelf>(TSelf excelDocument, Action<ExcelCalculationOptions> configure)` [#](#method-calculation-action-officeimo-excel-excelcalculationoptions)

Configures [ExcelDocument.Calculation](/api/excel/officeimo-excel-exceldocument/) in place: Formula calculation and cached-result policy used during save.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**configure System.Action<OfficeIMO.Excel.ExcelCalculationOptions> required**

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf Configure<TSelf>(TSelf excelDocument, Action<TSelf> configure)` [#](#method-configure-action)

Assigns callbacks and related configuration without invoking delegate-valued properties.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**configure System.Action<TSelf> required**

Assignments applied in order.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property                                                         // C# fluent
new global::OfficeIMO.Excel.ExcelDocument { DateTimeOffsetWriteStrategy = value };    excelDocument.Configure(configured => configured.DateTimeOffsetWriteStrategy = value);
```

`public static TSelf CustomProperties<TSelf>(TSelf excelDocument, Action<ExcelCustomDocumentPropertyCollection> configure)` [#](#method-customproperties-action-officeimo-excel-excelcustomdocumentpropertycollection)

Configures [ExcelDocument.CustomProperties](/api/excel/officeimo-excel-exceldocument/) in place: Custom workbook properties keyed by property name.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**configure System.Action<OfficeIMO.Excel.ExcelCustomDocumentPropertyCollection> required**

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf DateSystem<TSelf>(TSelf excelDocument, ExcelDateSystem value)` [#](#method-datesystem-officeimo-excel-exceldatesystem)

Sets [ExcelDocument.DateSystem](/api/excel/officeimo-excel-exceldocument/): Gets or sets the workbook date system used for serialized date values.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**value OfficeIMO.Excel.ExcelDateSystem required**

The value.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property                                        // C# fluent
new global::OfficeIMO.Excel.ExcelDocument { DateSystem = value };    excelDocument.DateSystem(value);
```

`public static TSelf DateTimeOffsetWriteMode<TSelf>(TSelf excelDocument, ExcelDateTimeOffsetWriteMode value)` [#](#method-datetimeoffsetwritemode-officeimo-excel-exceldatetimeoffsetwritemode)

Sets [ExcelDocument.DateTimeOffsetWriteMode](/api/excel/officeimo-excel-exceldocument/): Controls how DateTimeOffset values are written to worksheet cells. Defaults to [ExcelDateTimeOffsetWriteMode.Text](/api/excel/officeimo-excel-exceldatetimeoffsetwritemode/), which writes ISO 8601 text and keeps the offset. [ExcelDateTimeOffsetWriteMode.Serial](/api/excel/officeimo-excel-exceldatetimeoffsetwritemode/) writes date serials converted by [ExcelDocument.DateTimeOffsetWriteStrategy](/api/excel/officeimo-excel-exceldocument/).

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**value OfficeIMO.Excel.ExcelDateTimeOffsetWriteMode required**

The value.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property                                                     // C# fluent
new global::OfficeIMO.Excel.ExcelDocument { DateTimeOffsetWriteMode = value };    excelDocument.DateTimeOffsetWriteMode(value);
```

`public static TSelf DefaultChartStylePreset<TSelf>(TSelf excelDocument, ExcelChartStylePreset? value)` [#](#method-defaultchartstylepreset-officeimo-excel-excelchartstylepreset)

Sets [ExcelDocument.DefaultChartStylePreset](/api/excel/officeimo-excel-exceldocument/): Optional default chart style preset applied to charts created in this workbook.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**value OfficeIMO.Excel.ExcelChartStylePreset? required**

The value.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property                                                     // C# fluent
new global::OfficeIMO.Excel.ExcelDocument { DefaultChartStylePreset = value };    excelDocument.DefaultChartStylePreset(value);
```

`public static TSelf Execution<TSelf>(TSelf excelDocument, Action<ExcelExecutionPolicy> configure)` [#](#method-execution-action-officeimo-excel-excelexecutionpolicy)

Configures [ExcelDocument.Execution](/api/excel/officeimo-excel-exceldocument/) in place: Execution policy for controlling parallel vs sequential operations.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**configure System.Action<OfficeIMO.Excel.ExcelExecutionPolicy> required**

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf Properties<TSelf>(TSelf excelDocument, Action<ExcelBuiltinDocumentProperties> configure)` [#](#method-properties-action-officeimo-excel-excelbuiltindocumentproperties)

Configures [ExcelDocument.Properties](/api/excel/officeimo-excel-exceldocument/) in place: Built-in (core) document properties (Title, Creator, etc.).

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**configure System.Action<OfficeIMO.Excel.ExcelBuiltinDocumentProperties> required**

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf SheetCachingEnabled<TSelf>(TSelf excelDocument, bool value = true)` [#](#method-sheetcachingenabled-boolean)

Sets [ExcelDocument.SheetCachingEnabled](/api/excel/officeimo-excel-exceldocument/): Enables caching of [ExcelSheet](/api/excel/officeimo-excel-excelsheet/) wrappers for faster repeat access at the cost of higher memory usage. Set to false to avoid holding references to every sheet in very large workbooks.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**value bool = true optional**

The value; true when omitted.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property                                                 // C# fluent
new global::OfficeIMO.Excel.ExcelDocument { SheetCachingEnabled = value };    excelDocument.SheetCachingEnabled(value);
```

`public static TSelf TableNameComparer<TSelf>(TSelf excelDocument, IEqualityComparer<string> value)` [#](#method-tablenamecomparer-collections-generic-iequalitycomparer-system-string)

Sets [ExcelDocument.TableNameComparer](/api/excel/officeimo-excel-exceldocument/): Controls how workbook-level table name uniqueness is compared. Defaults to StringComparer.OrdinalIgnoreCase. Changing this will reset the internal cache and rebuild it on next use. Set it once before adding tables for predictable behavior.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**value System.Collections.Generic.IEqualityComparer<string> required**

The value.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property                                               // C# fluent
new global::OfficeIMO.Excel.ExcelDocument { TableNameComparer = value };    excelDocument.TableNameComparer(value);
```

`public static TSelf VbaProject<TSelf>(TSelf excelDocument, OfficeVbaProject project, OfficeVbaWriteOptions? options = null)` [#](#method-vbaproject-officeimo-officevbaproject-officeimo-officevbawriteoptions)

Applies a native source project, preserving unrelated payloads and requiring explicit VBA signature removal.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**project OfficeIMO.OfficeVbaProject required**

The value.

**options OfficeIMO.OfficeVbaWriteOptions? = null optional**

The value.

Returns

`TSelf` The same instance.

`public static TSelf WorkbookThemeName<TSelf>(TSelf excelDocument, string name)` [#](#method-workbookthemename-string)

Sets the workbook theme name while preserving the rest of the theme XML.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**name string required**

The value.

Returns

`TSelf` The same instance.

`public static TSelf WorkbookThemeXml<TSelf>(TSelf excelDocument, string themeXml)` [#](#method-workbookthemexml-string)

Replaces or creates the workbook theme part with caller-supplied DrawingML theme XML.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**themeXml string required**

The value.

Returns

`TSelf` The same instance.

`public static TSelf WriteReservation<TSelf>(TSelf excelDocument, ExcelWorkbookWriteReservationOptions? options = null)` [#](#method-writereservation-officeimo-excel-excelworkbookwritereservationoptions)

Writes workbook write-reservation metadata. This is not package encryption and does not protect worksheet or workbook structure.

Type Parameters

**TSelf**

Parameters

**excelDocument TSelf required**

The instance.

**options OfficeIMO.Excel.ExcelWorkbookWriteReservationOptions? = null optional**

The value.

Returns

`TSelf` The same instance.

## 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:110974B07B370C9FF51A7DFCA2BB9AA9297CB45DD7B8477528E2B4FC86BD4AF1 -->
