Class AbstractFormulaChangeMonitor
Class AbstractFormulaChangeMonitor
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Monitor for user to track the change of formulas during certain operations.
public abstract class AbstractFormulaChangeMonitor
Inheritance
object ← AbstractFormulaChangeMonitor
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
csharp
[C#]
Workbook wb = new Workbook("template.xlsx");
InsertOptions options = new InsertOptions();
options.FormulaChangeMonitor = new MyFormulaChangeMonitor(wb.Worksheets);
wb.Worksheets[0].Cells.InsertRows(0, 2, options);
class MyFormulaChangeMonitor : AbstractFormulaChangeMonitor
{
private readonly WorksheetCollection mWorksheets;
public MyFormulaChangeMonitor(WorksheetCollection worksheets)
{
mWorksheets = worksheets;
}
public override void OnCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)
{
Console.WriteLine("Cell " + mWorksheets[sheetIndex].Name + "!"
+ CellsHelper.CellIndexToName(rowIndex, columnIndex)
+ "'s formula was changed while inserting rows.");
}
}
Remarks
For example, while deleting/inserting range of cells, formulas of other cells may be changed because of the shift of references.
Constructors
AbstractFormulaChangeMonitor()
protected AbstractFormulaChangeMonitor()
Methods
OnCellFormulaChanged(int, int, int)
The event that will be triggered when the formula in a cell is changed.
public virtual void OnCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)
Parameters
sheetIndex
int
The sheet index of the changed cell
rowIndex
int
The row index of the changed cell
columnIndex
int
The column index of the changed cell