I am currently evaluating Aspose.Cells due to some limitation in another library, however I am finding somethings that work in the other library difficult to achieve here as well.
Specifically, I am unable to calculate workbook formulas that have external references, and those references are via INDIRECT functions e.g. =INDIRECT("[B.xlsx]Sheet1!MyNumber1")
Here is a simplified example, loading workbooks A.xlsx and B.xlsx, where A.xlsx has a reference to B.xlsx:
var workbookA = new Workbook(streamA);
workbookA.FileName = "A.xlsx"
var workbookB = new Workbook(streamB);
workbookB.FileName = "B.xlsx"
var externalLinks = new[]{workbookB};
workbookA.UpdateLinkedDataSource(externalLinks);
workbookA.CalculateFormula(new CalculationOptions());
If the workbook contains a formula such as: =SUM([B.XLSX]Sheet1!MyNumber1,2)
it works, formulas resolve and I can see the external link were found during load
var externalLinks = workbookA.Worksheets.ExternalLinks;
If the workbook contains a formula such as: =INDIRECT("[B.xlsx]Sheet1!MyNumber1")
it will not work, the formulas will not resolve. If there are no other external references, links are not found. I have tried calling:
foreach (var externalWorkbook in externalWorkbooks)
{
workbookA.Worksheets.ExternalLinks.Add(externalWorkbook.FileName, externalWorkbook.Worksheets.Select(x => x.Name).ToArray());
}
I have also tried to look for some solutions in setting properties, but there is limited access e.g. ExternalLink.IsReferred or Cell.ContainsExternalLink do not have setters.
Is this at all viable in Aspose.Cells?
Thanks