NativeExcel for .Net Developer's Reference

IWorksheet.StandardWidth Property

Gets or sets the standard (default) width of all the columns in the worksheet.

[Visual Basic]
PropertyStandardWidthAsDouble
[C#]
doubleStandardWidth{get;set;}
[C++]
__propertydoubleget_StandardWidth();
__propertyvoidset_StandardWidth(double);
[JScript]
functiongetStandardWidth():double
functionsetStandardWidth(double);

Property Value

Double. Standard (default) width of all the columns in the worksheet. One unit of column width is equal to the width of one character in the Normal style. For proportional fonts, the width of the character 0 (zero) is used.

Example

This example sets the width of column one on Sheet1 to the standard width.

[C#]
IWorksheet sheet = book.Worksheets["Sheet1"];
sheet.Cells.Columns[1].ColumnWidth = sheet.StandardWidth;
[VisualBasic]
Dim sheet As IWorksheet = book.Worksheets("Sheet1")
sheet.Cells.Columns(1).ColumnWidth = sheet.StandardWidth
[C++]
IWorksheet* sheet = book->Worksheets->Item[S"Sheet1"];
sheet->Cells->Columns->Item[1]->ColumnWidth = sheet->StandardWidth;

See Also

IWorksheet Interface | NativeExcel Namespace | StandardHeight Property