Ritwik
Ritwik

Reputation: 163

Range.getValues() fails with valid cell (Service error: Spreadsheets)

I have a script that's been run daily for at least the past year which has suddenly started failing (seemingly at random).

It fails when trying to call getValue() on a range that contains one cell. The code looks like this:

var ss = SpreadsheetApp.getActiveSpreadsheet();
var configSheet = ss.getSheetByName("Config");
Logger.log(configSheet);
Logger.log(configSheet.getRange(3,2));
Logger.log(configSheet.getRange(3,2).getValue());

It always fails on the last step with "Service error: Spreadsheets" on that line (which isn't particularly helpful as far as error messages go). Any ideas?

Other notes:

Upvotes: 1

Views: 558

Answers (2)

Ritwik
Ritwik

Reputation: 163

It started working again in a few hours with no intervention (same code as it used to be). I'll close this out - if anyone else has this problem, it's worth seeing if it eventually goes away (I believe it might be an internal problem).

Upvotes: 1

ScampMichael
ScampMichael

Reputation: 3728

what triggers the script to run?

You might try:

openById(id)

in lieu of getActiveSpreadsheet()

Upvotes: 0

Related Questions