Google Apps Script: TypeError: sheet.getActiveSheet is not a function - Global variable just started failing

Viewed 1166

In my google apps script, I have the following set outside of a function as global variables:

// Globals
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var actSheet = sheet.getActiveSheet();

today I started seeing this error in the chrome console.

Google Apps Script: TypeError: sheet.getActiveSheet is not a function

this code has been working fine for months... grrr.... This error is causing my onOpen() function to fail (because the script is dying on the declaration of var actSheet), so my sheets no longer have drop down menus displaying.

the idea behind the var sheet and var actSheet is they are global variables used throughout my code functions.

0 Answers
Related