Table of Contents

Method SetColumnWidth

Namespace
DocWright.Formats.Xlsx
Assembly
DocWright.Formats.Xlsx.dll

SetColumnWidth(int, decimal)

Sets a column's width.

public void SetColumnWidth(int column, decimal width)

Parameters

column int

The one-based column.

width decimal

The 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.