Cell.GetPrecedents() is not returning the correct worksheet name.
It used to work in v.18.104.22.168.
For reproducing the issue please use the following code:
var workbook = new Workbook();
if (workbook.Worksheets[“Sheet1”] == null)
if (workbook.Worksheets[“Sheet2”] == null)
var worksheet1 = workbook.Worksheets[“Sheet1”];
// the named range
workbook.Worksheets[“Sheet2”].Cells.CreateRange(“E5:I6”).Name = “someNamedRange_1”;
worksheet1.Cells[“A1”].Formula = “=SUM(someNamedRange_1)”;
var prec = worksheet1.Cells[“A1”].GetPrecedents();
// prec.SheetName should be “Sheet2” but it is "Sheet1"
Thanks for your posting and using Aspose.Cells.
We were able to observe this issue after running your sample code with the latest version: Aspose.Cells
for .NET v22.214.171.124. It should return Sheet2 but it is giving the wrong sheet i.e Sheet1.
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
- CELLSNET-43762 - Cell.GetPrecedents() not returning correct worksheet name