Method GetColumnWidth
GetColumnWidth(int)
Gets the width the sheet states for a column.
public decimal? GetColumnWidth(int column)
Parameters
columnintThe one-based column, 1 to 16,384.
Returns
- decimal?
The width in the file's unit, the same one Width takes: the number of characters of the default font, plus the cell's padding. Null when the sheet states no width for the column and Excel uses the sheet's default.
Remarks
Excel's own column-width figure is a little smaller than the stored one, because it leaves the padding out: a stored 30 is shown as 29.29.
Exceptions
- ArgumentOutOfRangeException
The column is outside the worksheet grid.
- InvalidDocumentException
The sheet's part is malformed.