In Excel, it is possible to create external links to files on the web. See docs (section “Create an external reference link to worksheet data on the web”). For example, this formula is allowed:
='https://preview.perfectxl.com/[Financial Sample.xlsx]Sheet1'!A1
Aspose.Cells is able to parse such formulas, but returns the formula with incorrect slashes. This is the formula given by Aspose.Cells:
='https:\\preview.perfectxl.com\[Financial Sample.xlsx]Sheet1'!A1
Can you fix this issue? We’re using Aspose.Cells v21.12.0.
I created an example spreadsheet: ExternalLinksUrl.xlsx.zip (70.9 KB)
And example code:
var workbook = new Workbook("ExternalLinksUrl.xlsx");
Cell cell1 = workbook.Worksheets["Sheet1"].Cells["A2"];
string formula1 = cell1.Formula;
// Actual: ='https:\\preview.perfectxl.com\[Financial Sample.xlsx]Sheet1'!A1
// Expected: ='https://preview.perfectxl.com/[Financial Sample.xlsx]Sheet1'!A1
Cell cell2 = workbook.Worksheets["Sheet1"].Cells["B4"];
string formula2 = cell2.Formula;
// Actual: =ROWS('https:\\preview.perfectxl.com\Financial Sample.xlsx'!financials[#Data])
// Expected: =ROWS('https://preview.perfectxl.com/Financial Sample.xlsx'!financials[#Data])
Name definedName = workbook.Worksheets.Names["FinancialData"];
string formula3 = definedName.RefersTo;
// Actual: ='https:\\preview.perfectxl.com\[Financial Sample.xlsx]Sheet1'!$A$2:$P$701
// Expected: ='https://preview.perfectxl.com/[Financial Sample.xlsx]Sheet1'!$A$2:$P$701