This is a follow-up to PowerQueryFormula.FormulaDefinition shows spurious let as we still experience issues with Aspose.Cell 20.8.0. The attached Excel file has 3 queries, one of them is read correctly (Extract PojectM), 1 is adding an “;” at the end (DataMashup) and one returns empty (UnzipContents).
The code we use to read the power queries is:
private void SerializePowerQueryFormulas(IEnumerable<Aspose.Cells.QueryTables.PowerQueryFormula> powerQueryFormulas)
{
foreach (var powerQueryFormula in powerQueryFormulas)
{
var contents = powerQueryFormula.FormulaDefinition.Replace("\r\n", "\n");
var loc = contents.Split('\n').Count();
});
}
}
ExtractCode.zip (17.4 KB)
Thanks for looking into this!