How to get the grouped row details in Office.JS excel add-in from the selected range.
Any kind of help will much appreciated!
How to get the grouped row details in Office.JS excel add-in from the selected range.
Any kind of help will much appreciated!
[Update] This does not address the question, but there is a sample in Script Lab that demonstrates how to do that. Go to the Samples tab in Script Lab and search for "Outline".
Here is the code to group rows:
Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getActiveWorksheet();
// Group the larger, main level. Note that the outline controls
// will be on row 10, meaning 4-9 will collapse and expand.
sheet.getRange("4:9").group(Excel.GroupOption.byRows);
// Group the smaller, sublevels. Note that the outline controls
// will be on rows 6 and 9, meaning 4-5 and 7-8 will collapse and expand.
sheet.getRange("4:5").group(Excel.GroupOption.byRows);
sheet.getRange("7:8").group(Excel.GroupOption.byRows);
await context.sync();
});