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

Free Support Forum - aspose.com

CalculationMonitor does not detect circular references

Hi,

The attached zip contains a simple excel file with circular references and an implementation of AbstractCalculationMonitor to detect the circular references. This example is based on your own examples at https://docs.aspose.com/cells/net/detecting-circular-reference/

But the circular references are not detected. Why not?

Thanks
Circular.zip (10.4 KB)

Using Aspose cells for Java version 21.8

@hbatteram,

I tested your sample code with your template file and got the following output:

Before: 0----8----2----C9 = 1.0
After: 0----8----2----C9 = 1.0
Before: 0----13----2----C14 = 0.0
Before: 0----13----6----G14 = 0.0
Before: 0----17----8----I18 = 0.0
Before: 0----20----6----G21 = 0.0
Before: 0----20----2----C21 = 0.0
Circular!
Before: 1----4----2----C5 = 0.0
Before: 1----4----6----G5 = 0.0
Before: 1----8----8----I9 = 0.0
Before: 1----11----6----G12 = 0.0
Before: 1----11----2----C12 = 0.0
Circular!
2 circular references found!

it seems not all circular references are detected. Could you provide your expected results? We will then evaluate it and log appropriate ticket for the issue.

Thank you for your quick response. I would expect at least three circular references since there are two independent loops on the first sheet and one on the second. Btw, an earlier attempt on an older version (Aspose Cells for Java 21.2) did not find any circular references.

Thanks

@hbatteram,
Thank you for providing more information. We have logged a ticket in our database for a detailed analysis and will write back here once any update is ready for sharing.

This issue is logged as:
CELLSJAVA-43767 - CulationMonitor does not detect all circular references

We keep on upgrading our library that is why the latest version is able to find the circular references. It is always recommended to use the latest library to get better performance and error free functionality.

@hbatteram,

We cannot find that there are two circular references in the first sheet. For Single!C14, the circular reference is C14->G14->I18->G21->C21->C14. For cell Single!C9, it refers to H9 and H9 is plain cell without formula, so there is no circular reference. In short, latest version gives correct and expected value.