Invalid PowerQueryFormula property for some connections

We have the following test file: PowerQueryTestConnections.xlsx.zip (20.1 KB)

This file contains 8 queries, each with a different PowerQuery definition. We found that for 4 connections, the property PowerQueryFormula is missing (null instead of the actual value). And for 1 connection, the PowerQueryFormula.FormulaDefinition is incorrect.

Here is the corresponding test code, with indications where the errors occur:

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

var connection = workbook.DataConnections[0];
var powerQueryName = connection.PowerQueryFormula?.Name; // error: null, expected: end_time
var powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition; // error: null, expected: not null

connection = workbook.DataConnections[1];
powerQueryName = connection.PowerQueryFormula?.Name; // error: null, expected: fill_url
powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition; // error: null, expected: not null

connection = workbook.DataConnections[2];
powerQueryName = connection.PowerQueryFormula?.Name;
powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition; // error: too many lines (last 4 lines belong to 'fill_url')

connection = workbook.DataConnections[3];
powerQueryName = connection.PowerQueryFormula?.Name;
powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition;

connection = workbook.DataConnections[4];
powerQueryName = connection.PowerQueryFormula?.Name;
powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition;

connection = workbook.DataConnections[5];
powerQueryName = connection.PowerQueryFormula?.Name; // expected: limit
powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition; // expected: not null

connection = workbook.DataConnections[6];
powerQueryName = connection.PowerQueryFormula?.Name; // expected: start_time
powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition; // expected: not null

connection = workbook.DataConnections[7];
powerQueryName = connection.PowerQueryFormula?.Name;
powerQueryFormula = connection.PowerQueryFormula?.FormulaDefinition;

You can see the expected outcome in Excel, by going to Data > Queries & Connections. For each query, right click > Edit and then go to ‘Advanced Editor’ to see the actual Power Query code.

Thank you for investigating and we hope you can resolve the invalid properties. We are using Aspose.Cells 24.10.0 for .NET.

We will look into it and get back to you as soon as possible.

@perfectxl,

Thanks for the template Excel file and details.

After initial testing, I was able to reproduce the issue as you mentioned by using your template XLSX file and sample code snippet. I found invalid PowerQueryFormula property values retrieved for some connections.

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-57031

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,

This is to inform you that your issue (Ticket ID: “CELLSNET-57031”) has been resolved. The enhancement/fix will be included in an upcoming release (Aspose.Cells v24.11) that we plan to release in the first half of November 2024. You will be notified when the next version is released.

Thank you for resolving the issue!

We found some more Excel files with similar problems, and we would like to check if this is the same issue or not. If possible, can you send us an intermediate test version (Aspose.Cells DLL file) with the fix? Then we can verify if the fix resolves the issue in all our test files, before Aspose.Cells v24.11 is released. We’ll share the results after testing.

@perfectxl

We are sorry but we do not share fixes in the normal support forums. We got to follow the policy across the board, the policy refers to fixes are posted in paid support desk only. In normal support forums, we can only share the results (if required) tested by our (internal) fix once we fix the issue. So, if you need to check the result of some other files with the new fix, please share them here and we will evaluate them and share the new results.

Okay. It is not easy to share the test files because they are confidential. Then we’ll wait for the next update of Aspose.Cells (v24.11) and evaluate the results. Thanks for the reply!

@perfectxl

You are welcome and thank you for your understanding. Please don’t hesitate to reach out to us again if you have any additional questions or issues with our component.

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