Cross sheet formula references are not being updated on DeleteRow()

If sheet1 contains a formula referring sheet2 cells, on deleting rows from sheet2 the formula on sheet1 does not get update.

Example - Sheet1 formula -> =Sheet2!E7+Sheet2!E9

On executing the code below:-
Workbook workbook = new Workbook(excelFilePath, new LoadOptions() { MemorySetting = MemorySetting.Normal });
workbook.Worksheets[1].Cells.DeleteRow(0);
workbook.Save(workbook.FileName);

The formula remains as it is…where as it should update by itself to -> =Sheet2!E6+Sheet2!E8

@ricky.patnaik,

You may please use DeleteRows() function by setting argument updateReference = true to update references in other sheets. Give a try to the following sample code and provide your feedback.

Workbook workbook = new Workbook(path + "book1.xlsx", new Aspose.Cells.LoadOptions() { MemorySetting = MemorySetting.Normal });
workbook.Worksheets[1].Cells.DeleteRows(0, 1, true);
workbook.Save(path + "output2.xlsx");

Thanks that worked.

@ricky.patnaik,

You are welcome.