Click or drag to resize

IgnoredErrorCollection Class

Represents a collection of an ignored errors in the worksheet.
Inheritance Hierarchy
SystemObject
  GemBox.SpreadsheetIgnoredErrorCollection

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1132
Syntax
public sealed class IgnoredErrorCollection : IEnumerable<IgnoredError>, 
	IEnumerable

The IgnoredErrorCollection type exposes the following members.

Properties
  NameDescription
Public propertyCount
Gets the number of IgnoredErrors contained in the IgnoredErrorCollection.
Public propertyItem
Gets the IgnoredError at the specified index.
Top
Methods
  NameDescription
Public methodAdd
Adds a new instance of an IgnoredError which instructs application to ignore all errors specified in the errorTypes parameter on the sequence of references to cell ranges specified in the appliesTo parameter.
Public methodClear
Removes all IgnoredErrors from the IgnoredErrorCollection.
Public methodGetEnumerator
Returns an enumerator that iterates through the IgnoredErrorCollection.
Public methodRemove
Removes the specified IgnoredError from the IgnoredErrorCollection.
Public methodRemoveAt
Removes the IgnoredError at the specified index of the IgnoredErrorCollection.
Top
Remarks

A cell is considered to have an error condition when it meets one of the conditions specified in the ErrorTypes member. For example, if a cell is formatted as text but contains a numeric value, this is considered to be a potential error because the number won't be treated as a number, for example, in calculations.

Note that this is simply a guess by the implementing application, and a recommendation to the user. Cells with the errors specified in IgnoredErrorTypes may have perfectly valid reasons for being in such a state, for example a cell formatted as text which contains numeric Postal Codes or Order numbers. It is useful to format these cells as text so that leading zeros remain as part of the value instead of being removed.

Examples

Following example shows that cells A1 and B1 both contain numbers stored as text, and this error has been reviewed and specifically flagged to be no longer surfaced as an error to the user.

var workbook = new ExcelFile();

var worksheet = workbook.Worksheets.Add("Sheet1");

worksheet.Cells["A1"].Value = "00385";
worksheet.Cells["B1"].Value = "00387";

worksheet.IgnoredErrors.Add("A1 B1", IgnoredErrorTypes.NumberStoredAsText);
See Also