We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

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 });

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


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.


You are welcome.