seinecle
seinecle

Reputation: 10778

How to get the currently selected cell/range with the Google Sheets API?

Same question as this one, but when using the Google API, not Google Apps Script. I use Java but an illustration in any language or REST would be good.

Upvotes: 0

Views: 1021

Answers (1)

Iamblichus
Iamblichus

Reputation: 19309

Answer:

You cannot do that, since the spreadsheet itself doesn't have a selected range. A certain user may have selected a range, but that information is not available to the API (see spreadsheet resource for further reference).

Explanation:

In Apps Script, bound scripts get the special privilege of using methods (e.g. getActiveRange()) that provide information on what the current user has selected (see Special methods).

But even using Apps Script, this cannot work in standalone scripts. Let alone using the API.

Upvotes: 1

Related Questions