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.