NativeExcel2 for .Net Developer's Reference

IRange.Width Property

Returns the width of the specified range.

[Visual Basic]
PropertyReadOnlyWidthAsDouble
[C#]
doubleWidth{get;}
[C++]
__propertydoubleget_Width();
[JScript]
functiongetWidth():double

Remarks

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 gets the width of selected range.

[C#]
 double width;
 width = book.Worksheets[1].Selection.Width;  
[VisualBasic]
 Dim width As Double 
 width = book.Worksheets(1).Selection.Width  
[C++]
 double width;
 width = book->Worksheets->Item[1]->Selection->Width;  

See Also

IRange Interface | NativeExcel Namespace | ColumnWidth Property | Height Property