# ExcelSheetFluent

The fluent methods of ExcelSheet, 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 [ExcelSheet](/api/excel/officeimo-excel-excelsheet/), 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
- ExcelSheetFluent

Filter members 

Show inherited

## Methods

`public static TSelf ColumnWidths<TSelf>(TSelf excelSheet, IReadOnlyDictionary<int, ExcelColumnWidth> columnWidths)` [#](#method-columnwidths-collections-generic-ireadonlydictionary-system-int32-officeimo-excel-excelcolumnwidth)

Applies positive custom widths together and saves the worksheet XML once. Existing column styles, visibility and outline metadata are preserved.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**columnWidths System.Collections.Generic.IReadOnlyDictionary<int, OfficeIMO.Excel.ExcelColumnWidth> required**

Widths keyed by 1-based column index. Widths above 255 are clamped.

Returns

`TSelf` The same instance.

`public static TSelf DefaultColumnWidth<TSelf>(TSelf excelSheet, ExcelColumnWidth width, bool save = true)` [#](#method-defaultcolumnwidth-officeimo-excel-excelcolumnwidth-boolean)

Sets the worksheet default column width from characters or a physical length.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**width OfficeIMO.Excel.ExcelColumnWidth required**

Default column width. Excel supports resolved widths up to 255 character units.

**save bool = true optional**

Whether to save the worksheet XML immediately.

Returns

`TSelf` The same instance.

`public static TSelf DefaultRowHeight<TSelf>(TSelf excelSheet, ExcelColumnWidth height, bool hidden = false, bool save = true)` [#](#method-defaultrowheight-officeimo-excel-excelcolumnwidth-boolean-boolean)

Sets the worksheet default row height from characters or a physical length.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**height OfficeIMO.Excel.ExcelColumnWidth required**

Default row height. Excel supports physical heights up to 409 points.

**hidden bool = false optional**

Whether empty rows should be hidden by default.

**save bool = true optional**

Whether to save the worksheet XML immediately.

Returns

`TSelf` The same instance.

`public static TSelf Document<TSelf>(TSelf excelSheet, Action<ExcelDocument> configure)` [#](#method-document-action-officeimo-excel-exceldocument)

Configures [ExcelSheet.Document](/api/excel/officeimo-excel-excelsheet/) in place: Gets the workbook that owns this worksheet.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

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

Configures the value.

Returns

`TSelf` The same instance.

ExecutionOverride``1 2 overloads

`public static TSelf ExecutionOverride<TSelf>(TSelf excelSheet, ExcelExecutionPolicy? value)` [#](#method-executionoverride-officeimo-excel-excelexecutionpolicy)

Sets [ExcelSheet.ExecutionOverride](/api/excel/officeimo-excel-excelsheet/): Override execution policy for this sheet. Null = inherit from document.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**value OfficeIMO.Excel.ExcelExecutionPolicy? required**

The value.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property            // C# fluent
excelSheet.ExecutionOverride = value;    excelSheet.ExecutionOverride(value);
```

`public static TSelf ExecutionOverride<TSelf>(TSelf excelSheet, Action<ExcelExecutionPolicy> configure)` [#](#method-executionoverride-action-officeimo-excel-excelexecutionpolicy)

Configures [ExcelSheet.ExecutionOverride](/api/excel/officeimo-excel-excelsheet/) in place (creating it when not set): Override execution policy for this sheet. Null = inherit from document.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

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

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf Hidden<TSelf>(TSelf excelSheet, bool hidden = true)` [#](#method-hidden-boolean)

Hides or shows the worksheet in the workbook.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**hidden bool = true optional**

The value. True when omitted.

Returns

`TSelf` The same instance.

`public static TSelf Name<TSelf>(TSelf excelSheet, string value)` [#](#method-name-string)

Sets [ExcelSheet.Name](/api/excel/officeimo-excel-excelsheet/): Gets or sets the worksheet name.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**value string required**

The value.

Returns

`TSelf` The same instance.

Examples

```csharp
// C# initializer or property    // C# fluent
excelSheet.Name = value;         excelSheet.Name(value);
```

`public static TSelf OutlineSummary<TSelf>(TSelf excelSheet, bool? summaryBelow = null, bool? summaryRight = null)` [#](#method-outlinesummary-nullable-system-boolean-nullable-system-boolean)

Configures the worksheet outline summary positions shown by Excel.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**summaryBelow bool? = null optional**

Whether row summaries should appear below grouped rows.

**summaryRight bool? = null optional**

Whether column summaries should appear to the right of grouped columns.

Returns

`TSelf` The same instance.

`public static TSelf PageSetup<TSelf>(TSelf excelSheet, Action<ExcelSheetPageSetup> configure)` [#](#method-pagesetup-action-officeimo-excel-excelsheetpagesetup)

Configures [ExcelSheet.PageSetup](/api/excel/officeimo-excel-excelsheet/) in place: Paper, orientation, scaling, margins, print area and titles, print options, headers and footers.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

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

Configures the value.

Returns

`TSelf` The same instance.

`public static TSelf TabColor<TSelf>(TSelf excelSheet, OfficeColor color)` [#](#method-tabcolor-officeimo-officecolor)

Sets a literal or theme-based worksheet tab color.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**color OfficeIMO.OfficeColor required**

A literal RGBA color, native theme role or status color.

Returns

`TSelf` The same instance.

`public static TSelf TableStyle<TSelf>(TSelf excelSheet, string tableOrRange, ExcelTableStyle style, bool? showFirstColumn = null, bool? showLastColumn = null, bool? showRowStripes = null, bool? showColumnStripes = null)` [#](#method-tablestyle-string-officeimo-excel-exceltablestyle-nullable-system-boolean-nullable-system-boolean-nullable-system-boolean-nullable-system-boolean)

Updates the visual style flags for the table identified by range, name, or display name.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**tableOrRange string required**

Table range, name, or display name.

**style OfficeIMO.Excel.ExcelTableStyle required**

Table style to apply.

**showFirstColumn bool? = null optional**

Optional first-column emphasis flag.

**showLastColumn bool? = null optional**

Optional last-column emphasis flag.

**showRowStripes bool? = null optional**

Optional row stripe flag.

**showColumnStripes bool? = null optional**

Optional column stripe flag.

Returns

`TSelf` The same instance.

`public static TSelf VeryHidden<TSelf>(TSelf excelSheet, bool veryHidden = true)` [#](#method-veryhidden-boolean)

Makes the worksheet very hidden, or restores it to visible.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

**veryHidden bool = true optional**

Whether to set the worksheet to the very hidden workbook state. True when omitted.

Returns

`TSelf` The same instance.

`public static TSelf View<TSelf>(TSelf excelSheet, Action<ExcelSheetView> configure)` [#](#method-view-action-officeimo-excel-excelsheetview)

Configures [ExcelSheet.View](/api/excel/officeimo-excel-excelsheet/) in place: Frozen panes, gridlines, zero values, headings, direction, zoom and view mode.

Type Parameters

**TSelf**

Parameters

**excelSheet TSelf required**

The instance.

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

Configures 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:AA8905264947D74F5E5AE6482C2D800F14541157C4522EC68118FAC9DA0B5635 -->
