NativeExcel for .Net Developer's Reference

IRange.Width Property

Returns the width of the specified range.

[Visual Basic]
Property ReadOnly Width As Double
[C#]
double Width { get; }
[C++]
__property double get_Width();
[JScript]
function get Width() : 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;  
[Visual Basic]
 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