Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelCellFluent

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Modifiers
static

The fluent methods of 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

Methods

public static ExcelCell Baseline(ExcelCell 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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

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) #

Sets or clears text wrapping.

Parameters

excelCell OfficeIMO.Excel.ExcelCell required
The instance.
wrapText bool = true optional
The value.

Returns

ExcelCell The same instance.