Reputation: 43
GetSelectedRange() allows to get the current worksheet user selected range, but doesn't allow to have a multiple selection.
ie: selected A1:B3 and C4:D8
Does anybody know how to make it work ?
My purpose is to set a new range (with name : ie: myRange) with multiple user selected range.
Thanks
Upvotes: 0
Views: 256
Reputation: 9784
The beta version of Office.js now has a Workbook.getSelectedRanges()
that returns a new RangeAreas
object. We're working on the documentation now.
To use the new APIs, you must load the beta version of the library from https://appsforoffice.microsoft.com/lib/beta/hosted/office.js
To get intellisense, use https://appsforoffice.microsoft.com/lib/beta/hosted/office.d.ts
You can also download a copy of the latter file. It has brief descriptions of the new APIs which is all we have until the docs are finished.
As always, we do not recommend using beta APIs in production add-ins.
UPDATE 2018/10/03:
We now have documentation for this feature: Working with multiple ranges
Upvotes: 1