ExcelColumnWidth
OfficeIMO.Excel
A worksheet dimension expressed in Excel character units or as a physical length.
Inheritance
- ValueType
- ExcelColumnWidth
Remarks
Character column widths retain the stored Excel value, including cell padding. Physical column widths resolve through the workbook default font and round to the nearest 96-DPI pixel. Row heights use the physical length directly; character heights use the default font's maximum digit advance, without column padding. A zero value clears a custom dimension.
Usage
Explore 23 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 13
- Property ExcelColumnInfo.Width
- Property ExcelColumnSizingOptions.LongWidth
- Property ExcelColumnSizingOptions.MediumWidth
- Property ExcelColumnSizingOptions.NumericWidth
- Property ExcelColumnSizingOptions.ShortWidth
- Property ExcelColumnSizingOptions.WidthByHeader
- Property ExcelColumnSizingOptions.WrapWidth
- Method ExcelColumnWidth.Characters
- Method ExcelColumnWidth.Length
- Property ExcelRowInfo.Height
- Property ExcelRowLayoutOptions.Height
- Property ExcelSheet.DefaultColumnWidth
- Property ExcelSheet.DefaultRowHeight
Accepted by parameters 10
- Method ExcelColumnWidth.Equals
- Method ExcelColumnWidth.op_Equality
- Method ExcelColumnWidth.op_Equality
- Method ExcelColumnWidth.op_Inequality
- Method ExcelColumnWidth.op_Inequality
- Method ExcelSheet.SetColumnWidth
- Method ExcelSheet.SetColumnWidths
- Method ExcelSheet.SetDefaultColumnWidth
- Method ExcelSheet.SetDefaultRowHeight
- Method ExcelSheet.SetRowHeight
Methods
public static ExcelColumnWidth Characters(double value) #Creates a dimension in Excel character units. Non-finite values are rejected.
Parameters
- value double
Returns
ExcelColumnWidthpublic bool Equals(ExcelColumnWidth other) #Indicates whether the current object is equal to another object of the same type.
Parameters
- other OfficeIMO.Excel.ExcelColumnWidth
- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.public override bool Equals(object? obj) #Indicates whether this instance and a specified object are equal.
Parameters
- obj object?
- The object to compare with the current instance.
Returns
bool true if obj and this instance are the same type and represent the same value; otherwise, false.public override int GetHashCode() #Returns the hash code for this instance.
Returns
int A 32-bit signed integer that is the hash code for this instance.public static ExcelColumnWidth Length(OfficeLength value) #Creates a dimension from an explicit physical length.
Parameters
- value OfficeIMO.OfficeLength
Returns
ExcelColumnWidthpublic static bool op_Equality(ExcelColumnWidth left, ExcelColumnWidth right) #Compares dimensions in the same authored unit. Conversion requires a worksheet.
Parameters
- left OfficeIMO.Excel.ExcelColumnWidth
- right OfficeIMO.Excel.ExcelColumnWidth
Returns
boolpublic static bool op_Inequality(ExcelColumnWidth left, ExcelColumnWidth right) #Compares dimensions in the same authored unit. Conversion requires a worksheet.
Parameters
- left OfficeIMO.Excel.ExcelColumnWidth
- right OfficeIMO.Excel.ExcelColumnWidth
Returns
boolpublic double ToCharacters(ExcelSheet sheet) #Gets the stored column width for a worksheet, resolving physical values through its default font.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
Returns
doublepublic OfficeLength ToLength(ExcelSheet sheet) #Gets the physical column width for a worksheet, including native column padding and pixel rounding.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
Returns
OfficeLengthpublic override string ToString() #Formats the specified dimension using invariant units.
Returns
stringInherited Methods
Properties
public double? CharacterCount { get; } #Gets the authored character count, or null for a physical length. No workbook is needed.
public OfficeLength? PhysicalLength { get; } #Gets the authored physical length, or null for a character count. No workbook is needed.
public bool IsPhysical { get; } #Gets whether the value was specified as a physical length.