Version

Width Property (WorksheetColumn)

Gets or sets the column width including padding, in 256ths of the '0' digit character width in the workbook's default font.
Syntax
'Declaration
 
Public Property Width As Integer
public int Width {get; set;}

Property Value

The column width including padding, in 256ths of the '0' digit character width in the workbook's default font.
Exceptions
ExceptionDescription
System.InvalidOperationExceptionFrom the setter if the column was removed from the worksheet.
Remarks

If the width of the column is less than zero, the DefaultColumnWidth of the owning worksheet will be used as the column's width.

The value assigned must be between -1 and 65535. Invalid values will be automatically adjusted to valid values.

Setting or getting this property is equivalent to calling SetWidth or GetWidth using the WorksheetColumnWidthUnit value of Character256th.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also