Table of Contents

Method InsertColumns

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

InsertColumns(int, int, XlsxInsertOptions?)

Inserts columns; the columns from at on move right.

public void InsertColumns(int at, int count = 1, XlsxInsertOptions? options = null)

Parameters

at int

The one-based column the first new column becomes.

count int

How many columns.

options XlsxInsertOptions

Where the new columns take their format from; null for the column to the left, as in Excel.

Remarks

See InsertRows(int, int, XlsxInsertOptions?). Column widths and hidden columns move with their columns.

Exceptions

ArgumentOutOfRangeException

The columns are not inside the grid.

InvalidOperationException

The sheet is not a worksheet, or the insert would push cells off the end of the sheet.

UnsupportedFeatureException

The columns would split an array formula, or are inside a table.

ResourceLimitExceededException

The format copied is more cells than MaxFormattedCells.

InvalidDocumentException

A part of the workbook is malformed.