Version

GetWidth Method

Gets the column width in the specified units, or NaN if the column has the default width.
Syntax
'Declaration
 
Public Function GetWidth( _
   ByVal units As WorksheetColumnWidthUnit _
) As Double
public double GetWidth( 
   WorksheetColumnWidthUnit units
)

Parameters

units
The units in which the width should be returned.

Return Value

The column width in the specified units, or NaN if the column has the default width.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionunits is not defined in the WorksheetColumnWidthUnit enumeration.
Remarks

If units is Character256th, the value returned will be the same as the value of the Width property, with one exception: if the column has the default width, this method will return NaN and Width will return -1.

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