Class ErrorCheckOption

Class ErrorCheckOption

Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)

Error check setting applied on certain ranges.

public class ErrorCheckOption

Inheritance

objectErrorCheckOption

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

Workbook workbook = new Workbook();
  ErrorCheckOptionCollection opts = workbook.Worksheets[0].ErrorCheckOptions;
  int optionIdx = opts.Add();
  ErrorCheckOption opt = opts[optionIdx];
  opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.InconsistFormula, false);
  opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.InconsistRange, false);
  opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.TextDate, false);
  opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.TextNumber, false);
  opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.Validation, false);
  opt.AddRange(CellArea.CreateCellArea("A1", "B10"));
  workbook.Save(@"Book1.xlsx");
Dim workbook As Workbook = New Workbook()
   Dim opts As ErrorCheckOptionCollection = workbook.Worksheets(0).ErrorCheckOptions
   Dim optionIdx As Integer = opts.Add()
   Dim opt As ErrorCheckOption = opts(optionIdx)
   opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.InconsistFormula, False)
   opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.InconsistRange, False)
   opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.TextDate, False)
   opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.TextNumber, False)
   opt.SetErrorCheck(Aspose.Cells.ErrorCheckType.Validation, False)
   opt.AddRange(CellArea.CreateCellArea("A1", "B10"))
   workbook.Save("Book1.xlsx")

Methods

AddRange(CellArea)

Adds one influenced range by this setting.

public int AddRange(CellArea ca)

Parameters

ca CellArea

the range to be added.

Returns

int

the index of the added range in the range list of this setting.

GetCountOfRange()

Gets the count of ranges that influenced by this setting.

public int GetCountOfRange()

Returns

int

the count of ranges that influenced by this setting.

GetRange(int)

Gets the influenced range of this setting by given index.

public CellArea GetRange(int index)

Parameters

index int

the index of range

Returns

CellArea

return influenced range at given index.

IsErrorCheck(ErrorCheckType)

Checks whether given error type will be checked.

public bool IsErrorCheck(ErrorCheckType errorCheckType)

Parameters

errorCheckType ErrorCheckType

error type can be checked

Returns

bool

return true if given error type will be checked(green triangle will be shown for cell if the check failed).

RemoveRange(int)

Removes one range by given index.

public void RemoveRange(int index)

Parameters

index int

the index of the range to be removed.

SetErrorCheck(ErrorCheckType, bool)

Sets whether given error type will be checked.

public void SetErrorCheck(ErrorCheckType errorCheckType, bool isCheck)

Parameters

errorCheckType ErrorCheckType

error type can be checked.

isCheck bool

true if given error type needs to be checked(green triangle will be shown for cell if the check failed).