Table of Contents

Method AddList

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

AddList(XlsxCellRange, params string[])

Adds a list rule whose items the rule itself holds (Excel's Source box with North,South,East), with the in-cell dropdown.

public XlsxDataValidation AddList(XlsxCellRange range, params string[] values)

Parameters

range XlsxCellRange

The cells the rule covers.

values string[]

The items, in order; none may hold a comma or a double quote, and together they are at most 4,095 characters with their commas (Excel refuses a longer list when it opens the file).

Returns

XlsxDataValidation

The rule.

Exceptions

ArgumentNullException

values or an item is null.

ArgumentException

There is no item, an item cannot be written, or the list is too long.

InvalidOperationException

The sheet is not a worksheet.

InvalidDocumentException

A part of the workbook is malformed.