# ExcelCellFluent

The fluent methods of ExcelCell, 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 [ExcelCell](/api/excel/officeimo-excel-excelcell/), 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
- ExcelCellFluent

Filter members 

Show inherited

## Methods

`public static ExcelCell Baseline(ExcelCell excelCell)` [#](#method-baseline-officeimo-excel-excelcell)

Restores the cell text to the normal baseline.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Bold(ExcelCell excelCell, bool bold = true)` [#](#method-bold-officeimo-excel-excelcell-boolean)

Sets or clears bold font style.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**bold bool = true optional**

The value.

Returns

`ExcelCell` The same instance.

Border 2 overloads

`public static ExcelCell Border(ExcelCell excelCell, ExcelBorderStyle style, OfficeColor? color = null)` [#](#method-border-officeimo-excel-excelcell-officeimo-excel-excelborderstyle-nullable-officeimo-officecolor)

Applies a border style to the cell.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**style OfficeIMO.Excel.ExcelBorderStyle required**

The value.

**color OfficeIMO.OfficeColor? = null optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Border(ExcelCell excelCell, ExcelCellBorders borders, ExcelBorderStyle style, OfficeColor? color = null)` [#](#method-border-officeimo-excel-excelcell-officeimo-excel-excelcellborders-officeimo-excel-excelborderstyle-nullable-officeimo-officecolor)

Sets selected border edges while preserving other edges and cell styles.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**borders OfficeIMO.Excel.ExcelCellBorders required**

The value.

**style OfficeIMO.Excel.ExcelBorderStyle required**

The value.

**color OfficeIMO.OfficeColor? = null optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Color(ExcelCell excelCell, OfficeColor color)` [#](#method-color-officeimo-excel-excelcell-officeimo-officecolor)

Sets the font color using a hex color value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**color OfficeIMO.OfficeColor required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell DiagonalBorder(ExcelCell excelCell, ExcelBorderStyle style, OfficeColor? color = null, bool diagonalUp = true, bool diagonalDown = true)` [#](#method-diagonalborder-officeimo-excel-excelcell-officeimo-excel-excelborderstyle-nullable-officeimo-officecolor-boolean-boolean)

Applies diagonal borders to the cell.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**style OfficeIMO.Excel.ExcelBorderStyle required**

The value.

**color OfficeIMO.OfficeColor? = null optional**

The value.

**diagonalUp bool = true optional**

The value.

**diagonalDown bool = true optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Error(ExcelCell excelCell, string errorText)` [#](#method-error-officeimo-excel-excelcell-string)

Writes a native Excel error value, such as #N/A or #DIV/0!.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**errorText string required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell FillColor(ExcelCell excelCell, OfficeColor color)` [#](#method-fillcolor-officeimo-excel-excelcell-officeimo-officecolor)

Sets the solid fill color. Theme colors stay linked to the workbook theme.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**color OfficeIMO.OfficeColor required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell FontFamily(ExcelCell excelCell, string fontFamily)` [#](#method-fontfamily-officeimo-excel-excelcell-string)

Sets the font family name.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**fontFamily string required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell FontSize(ExcelCell excelCell, OfficeLength fontSize)` [#](#method-fontsize-officeimo-excel-excelcell-officeimo-officelength)

Sets a positive physical font size.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**fontSize OfficeIMO.OfficeLength required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Formula(ExcelCell excelCell, string formula)` [#](#method-formula-officeimo-excel-excelcell-string)

Sets the cell formula while keeping any existing value as its cached result. This is not a redaction API: rebuild the workbook from approved data to remove sensitive historic content.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**formula string required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell GradientFill(ExcelCell excelCell, OfficeColor fromColor, OfficeColor toColor, double degree = 0)` [#](#method-gradientfill-officeimo-excel-excelcell-officeimo-officecolor-officeimo-officecolor-double)

Sets a two-color linear gradient fill using literal or theme colors.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**fromColor OfficeIMO.OfficeColor required**

The value.

**toColor OfficeIMO.OfficeColor required**

The value.

**degree double = 0 optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell HorizontalAlignment(ExcelCell excelCell, ExcelHorizontalAlignment alignment)` [#](#method-horizontalalignment-officeimo-excel-excelcell-officeimo-excel-excelhorizontalalignment)

Sets the horizontal alignment.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**alignment OfficeIMO.Excel.ExcelHorizontalAlignment required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Italic(ExcelCell excelCell, bool italic = true)` [#](#method-italic-officeimo-excel-excelcell-boolean)

Sets or clears italic font style.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**italic bool = true optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell NumberFormat(ExcelCell excelCell, string numberFormat)` [#](#method-numberformat-officeimo-excel-excelcell-string)

Applies a number format to the cell.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**numberFormat string required**

The value.

Returns

`ExcelCell` The same instance.

RichText 2 overloads

`public static ExcelCell RichText(ExcelCell excelCell, params ExcelRichTextRun[] runs)` [#](#method-richtext-officeimo-excel-excelcell-officeimo-excel-excelrichtextrun)

Replaces the cell contents with rich inline text runs.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**runs OfficeIMO.Excel.ExcelRichTextRun[] required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell RichText(ExcelCell excelCell, IEnumerable<ExcelRichTextRun> runs)` [#](#method-richtext-officeimo-excel-excelcell-collections-generic-ienumerable-officeimo-excel-excelrichtextrun)

Replaces the cell contents with rich inline text runs.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**runs System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelRichTextRun> required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell ShrinkToFit(ExcelCell excelCell, bool shrinkToFit = true)` [#](#method-shrinktofit-officeimo-excel-excelcell-boolean)

Sets or clears shrink-to-fit text alignment.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**shrinkToFit bool = true optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Strikethrough(ExcelCell excelCell, bool strikethrough = true)` [#](#method-strikethrough-officeimo-excel-excelcell-boolean)

Sets or clears strikethrough font style.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**strikethrough bool = true optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Subscript(ExcelCell excelCell)` [#](#method-subscript-officeimo-excel-excelcell)

Formats the cell text as subscript.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Superscript(ExcelCell excelCell)` [#](#method-superscript-officeimo-excel-excelcell)

Formats the cell text as superscript.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

Returns

`ExcelCell` The same instance.

`public static ExcelCell TextRotation(ExcelCell excelCell, int rotation)` [#](#method-textrotation-officeimo-excel-excelcell-int32)

Sets Excel text rotation. Use 0-90 for upward rotation, 91-180 for downward rotation, or 255 for stacked vertical text.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**rotation int required**

The value.

Returns

`ExcelCell` The same instance.

Underline 2 overloads

`public static ExcelCell Underline(ExcelCell excelCell, bool underline = true)` [#](#method-underline-officeimo-excel-excelcell-boolean)

Sets or clears underline font style.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**underline bool = true optional**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Underline(ExcelCell excelCell, ExcelUnderlineStyle underlineStyle)` [#](#method-underline-officeimo-excel-excelcell-officeimo-excel-excelunderlinestyle)

Sets the native Excel underline style.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**underlineStyle OfficeIMO.Excel.ExcelUnderlineStyle required**

The value.

Returns

`ExcelCell` The same instance.

Value 19 overloads

`public static ExcelCell Value(ExcelCell excelCell, object? value)` [#](#method-value-officeimo-excel-excelcell-object)

Sets the cell value, inferring the stored type. Dates and times get a date or duration number format unless the cell already has one.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value object? required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, string value)` [#](#method-value-officeimo-excel-excelcell-string)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value string required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, double value)` [#](#method-value-officeimo-excel-excelcell-double)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value double required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, float value)` [#](#method-value-officeimo-excel-excelcell-single)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value float required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, decimal value)` [#](#method-value-officeimo-excel-excelcell-decimal)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value decimal required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, int value)` [#](#method-value-officeimo-excel-excelcell-int32)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value int required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, long value)` [#](#method-value-officeimo-excel-excelcell-int64)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value long required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, short value)` [#](#method-value-officeimo-excel-excelcell-int16)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value short required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, uint value)` [#](#method-value-officeimo-excel-excelcell-uint32)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value uint required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, ulong value)` [#](#method-value-officeimo-excel-excelcell-uint64)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value ulong required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, ushort value)` [#](#method-value-officeimo-excel-excelcell-uint16)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value ushort required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, byte value)` [#](#method-value-officeimo-excel-excelcell-byte)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value byte required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, sbyte value)` [#](#method-value-officeimo-excel-excelcell-sbyte)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value sbyte required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, bool value = true)` [#](#method-value-officeimo-excel-excelcell-boolean)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value bool = true optional**

The value. True when omitted.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, DateTime value)` [#](#method-value-officeimo-excel-excelcell-datetime)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value System.DateTime required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, DateTimeOffset value)` [#](#method-value-officeimo-excel-excelcell-datetimeoffset)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value System.DateTimeOffset required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, TimeSpan value)` [#](#method-value-officeimo-excel-excelcell-timespan)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value System.TimeSpan required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, DateOnly value)` [#](#method-value-officeimo-excel-excelcell-dateonly)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value System.DateOnly required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell Value(ExcelCell excelCell, TimeOnly value)` [#](#method-value-officeimo-excel-excelcell-timeonly)

Sets Value.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**value System.TimeOnly required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell VerticalAlignment(ExcelCell excelCell, ExcelVerticalAlignment alignment)` [#](#method-verticalalignment-officeimo-excel-excelcell-officeimo-excel-excelverticalalignment)

Sets the vertical alignment.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**alignment OfficeIMO.Excel.ExcelVerticalAlignment required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell VerticalTextAlignment(ExcelCell excelCell, ExcelVerticalTextAlignment alignment)` [#](#method-verticaltextalignment-officeimo-excel-excelcell-officeimo-excel-excelverticaltextalignment)

Sets the native Excel baseline, superscript, or subscript alignment.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**alignment OfficeIMO.Excel.ExcelVerticalTextAlignment required**

The value.

Returns

`ExcelCell` The same instance.

`public static ExcelCell WrapText(ExcelCell excelCell, bool wrapText = true)` [#](#method-wraptext-officeimo-excel-excelcell-boolean)

Sets or clears text wrapping.

Parameters

**excelCell OfficeIMO.Excel.ExcelCell required**

The instance.

**wrapText bool = true optional**

The value.

Returns

`ExcelCell` 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:421B3C562FE2FCF1D4AC66E2F4184D2CB95F7F5415FF782766BAFF1E1B60AD81 -->
