Joaquín M
Joaquín M

Reputation: 1153

Script started throwing "Reference error SpreadsheetApp is undefined "

I made an script for a Google Sheets. It's been a month since people used it and worked perfectly.

Basically the script looks in a spreadsheet, makes some formulas with the data and returns a value.

At the beginning of the script I call for "SpreadsheetApp.getActiveSpreadsheet()" function that returns me the actual spreadsheet. The problem is that sometimes the script returns an error that says "Reference error: SpreadsheetApp is undefined".

The weird thing is that if I close the Spreadsheet and open it again after 5 minutes (random time) the script works well! I can't find the error pattern. I don't know if it's something I made, or something from Google.

Can anyone help me?

Upvotes: 0

Views: 1067

Answers (1)

Ivan Kutil
Ivan Kutil

Reputation: 46

Try open spreadsheet by ID

SpreadsheetApp.openById("0sdfksdlfkjsdlkfj_example_fdslkfjlsjkf");

Upvotes: 1

Related Questions