'Syncfusion XLSIO breaks excel cross sheet references

I am using Syncfusion XLSIO to combine a set of excel sheets that use internal references to a translation worksheet.

If I only export one report at a time this works perfectly, however when i combine them with the code below all excel formula references break.

IWorkbook combinedWorkbook =
            application.Workbooks.Create();
        

        foreach (GradingSheet sheet in bulkExportClass.GradingSheets)
        {
            IWorkbook workbook =
                await this._exportService.GetCorrespondingReport(sheet);
            workbook.CalculationOptions.CalculationMode =
                ExcelCalculationMode.Manual;
            combinedWorkbook.Worksheets.AddCopy(workbook.Worksheets[0]);
            
        }

        await using MemoryStream stream = new MemoryStream();
        combinedWorkbook.SaveAs(stream);

If I check the generated sheets formulas it shows the following:

=IF('/[Book1]#REF'!B1 = "EN";'/[Book1]#REF'!A6;+IF('/[Book1]#REF'!B1="DE";'/[Book1]#REF'!B6;IF('/[Book1]#REF'!B1 = "FR";'/[Book1]#REF'!C6)))

Is there any way to not break these formulas on copy?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source