Method SetColumnWidth
SetColumnWidth(int, decimal)
Sets a column's width.
public void SetColumnWidth(int column, decimal width)
Parameters
columnintThe one-based column.
widthdecimalThe width in the file's unit (see GetColumnWidth(int)), 0 to 255. Zero hides the column.
Remarks
Whatever else the sheet says about the column - a column style, an outline level - is kept. A column that was marked hidden stays hidden until it is unhidden in Excel.
Exceptions
- ArgumentOutOfRangeException
The column is outside the worksheet grid, or the width is outside 0 to 255.
- InvalidOperationException
The sheet is not a worksheet.