Open FullStackEngN opened 1 year ago
Thank you for letting us know about this issue. We will take a look shortly. Thanks.
Hi @FullStackEngN we created a work item internally to track this bug. Currently, writing the fomula as =AVERAGE(Sheet2!A1:F2)
should be a workaround for this case.
Thanks @honxmsft , I have already provided the customer with the workaround. However, they mentioned that the formula is defined by a user, which is beyond their control. The user who utilizes 'getDirectPrecedents' and the user responsible for the formula belong to different groups, making the workaround challenging for them. The customer is eagerly awaiting a fix for this issue.
I had a formula(AVERAGE(Sheet2!A1:Sheet2!F2)) in Sheet1, then the getDirectPrecedents return "Sheet1!A1:F2, Sheet2!A1 and Sheet2!F2" for the cell, the "Sheet1!A1:F2" is not right response. But the issue only happen in Excel Online, it returns right response in Excel Desktop.
Expected Behavior
It should not return "Sheet1!A1:F2".
Current Behavior
The result contains "Sheet1!A1:F2".
Steps to Reproduce, or Live Example
Use code get the A2 direct precedents. ` var range = sheet.getRange("A2"); var precedents = range.getPrecedents(); var directPrecedents = range.getDirectPrecedents();
range.load("address"); precedents.areas.load("address"); directPrecedents.areas.load("address");
await context.sync();
console.log(
All precedent cell of ${range.address}:
);// Use the precedents API to loop through all precedents of the active cell. for (let i = 0; i < precedents.areas.items.length; i++) { // Highlight and print out the address of all precedent cells. precedents.areas.items[i].format.fill.color = "Orange"; console.log(
${precedents.areas.items[i].address}
); }console.log(
Direct precedent cells of ${range.address}:
);// Use the direct precedents API to loop through direct precedents of the active cell. for (let i = 0; i < directPrecedents.areas.items.length; i++) { // Highlight and print out the address of each direct precedent cell. directPrecedents.areas.items[i].format.fill.color = "Yellow"; console.log(
${directPrecedents.areas.items[i].address}
); }`Context
Your Environment
Useful logs