No forward slashes but backward slashes for external links with URL

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

@perfectxl,

Please notice, I am able to reproduce the issue as you mentioned by using your template file. I found Aspose.Cells retrieves backward slashes instead of forward slashes for external links with URL in the formulas. I have logged a ticket with an id “CELLSNET-50585” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

The issues you have found earlier (filed as CELLSNET-50585) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Thank you for the bugfix!

@perfectxl,

You are welcome.