Table of Contents

Method Validate

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

Validate(string, XlsxCellValue)

Returns whether the rule over a cell would accept a value, as Excel judges a value typed into it (measured with Excel's own Validation.Value): true when no rule covers the cell.

public bool? Validate(string reference, XlsxCellValue value)

Parameters

reference string

The cell, such as B2.

value XlsxCellValue

The value.

Returns

bool?

True or false; null when the answer needs a formula calculated (a bound or a list given by a reference or a name, a custom rule) or was not measured (see Accepts(XlsxCellValue)).

Exceptions

ArgumentException

The reference is not a cell.

InvalidOperationException

The sheet is not a worksheet.

InvalidDocumentException

A part of the workbook is malformed.

Validate(int, int, XlsxCellValue)

Returns whether the rule over a cell would accept a value. See Validate(string, XlsxCellValue).

public bool? Validate(int row, int column, XlsxCellValue value)

Parameters

row int

The one-based row.

column int

The one-based column.

value XlsxCellValue

The value.

Returns

bool?

True or false; null when the answer needs a formula calculated or was not measured.

Exceptions

ArgumentOutOfRangeException

The cell is outside the grid.

InvalidOperationException

The sheet is not a worksheet.

InvalidDocumentException

A part of the workbook is malformed.