Why this command doesn't work on Excel Scripts (TypeScript)?
Hello all,
I would like to know why this command doesn't work at all.
I've tried every platform (Online and Offline Software) and this command doesn't work either, also if I'm trying to record this, Excel shows up with an error: "Unable to record this action".
This is the standard script that comes from Excel when I'm trying to share this action:
let selectedSheet = workbook.getActiveWorksheet();
// Sort the range range G4:L4 on selectedSheet
selectedSheet.getRange("G4:L4").getSort().apply([{ key: 0, ascending: false }], false, true, ExcelScript.SortOrientation.rows);
It seems the SortOrientation by Row doesn't ever be applied.
In addition, I tried to ask this question in the Microsoft community but I was redirected here.
Also, I tried the two workaround suggested:
You may try changing the range being sorted to a larger range, such as "G4:L10", to see if the issue persists. Additionally, you can try using the SortFields object to specify the sort order instead of passing an array of objects to the apply method.
Unfortunately, still doesn't work.