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
referencestringThe cell, such as
B2.valueXlsxCellValueThe 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
rowintThe one-based row.
columnintThe one-based column.
valueXlsxCellValueThe 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.