PFA workbook: ExternalLinks.zip (7.1 KB)
In cells A1:A3, there are formulas that link to an external workbook that has not been saved (Book3):
In Aspose, these external links are not properly escaped with single quotes as in the Excel version:
When trying to set the same formula to another cells an error occurs because it is not properly escaped with single quotes (worksheets have spaces in them)
Source code I used with attached workbook:
using (var workbook =
new Workbook(
@"ExternalLinks.xlsx"))
{
var worksheet = workbook.Worksheets[0];
var formula1 = worksheet.Cells["A1"].Formula;
var formula2 = worksheet.Cells["A2"].Formula;
var formula3 = worksheet.Cells["A3"].Formula;
worksheet.Cells["B1"].Formula = formula1;
worksheet.Cells["B2"].Formula = formula2;
worksheet.Cells["B3"].Formula = formula3;
}
The error returned is:
“Unknown token with bracket: 13(Based on cell Sheet1!B2)”
Thanks,
Dean