Incorrect item in data connections and query table

We have the following test file: IncorrectConnections.xlsx.zip (36.9 KB)

This file contains one query (aandelenratings) as can be seen in the “Queries & Connections” pane in Excel. In addition, it contains one hidden connection (ThisWorkbookDataModel) because a data model is present.

However, Aspose.Cells has three issues with this file:
(1) The workbook.DataConnections collection returns three items, but two are expected
(2) The PowerQueryFormula property is null for the connection that represents the query
(3) The ExternalConnection property of the related query does not link to the connection that represents the query

It can be demonstrated by the following test code:

var workbook = new Workbook("IncorrectConnections.xlsx");

var connection = workbook.DataConnections[0];
Console.WriteLine(connection.Name); // ModelConnection_ExternalData_1, expected: not present
Console.WriteLine(connection.PowerQueryFormula);

connection = workbook.DataConnections[1];
Console.WriteLine(connection.Name); // Query - aandelenratings
Console.WriteLine(connection.PowerQueryFormula); // null, expected: not null

connection = workbook.DataConnections[2];
Console.WriteLine(connection.Name); // ThisWorkbookDataModel
Console.WriteLine(connection.PowerQueryFormula);

var table = workbook.Worksheets[0].QueryTables[0];
Console.WriteLine(table.ExternalConnection.Name); // ModelConnection_ExternalData_1, expected: Query - aandelenratings

Can you reproduce these issues and provide a fix? We’re using Aspose.Cells 24.11.0 for .NET.

@perfectxl,

Thanks for the template Excel file.

After initial testing, I was able to reproduce the issues you mentioned by using your template Excel file. I found some incorrect items in data connections and query table retrieved.

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-57308

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@perfectxl

  1. In the file, there are 3 connections (unzip the file, check xl/connections.xml). We do not know which is useless. So we can not filter the first connection now.

@perfectxl
We have fixed the issue 2 and 3. We will include the fix into the next version 24.12.

Okay, if issue 2 and 3 are fixed, I think we can manage to determine the correct connections to use. Thank you!

@perfectxl
You are welcome!

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