Strange behaviour when declaring a global variables - Error (logs): "ss.getSheetByName is not a function"

Viewed 39

Hope somebody can help me.

The script will not even allow me to declare global variables. This code was working flawlessly and it stopped working for most users, still works with some users in our company's Google Workspace. Really strange:

Below is how the code starts (declaring global variables).

var ss = SpreadsheetApp.getActiveSpreadsheet();
var cotizadorss =  ss.getSheetByName("Cotizador");
var financiass = ss.getSheetByName("Financiamiento");
var pedidoss = ss.getSheetByName("Pedido");
var compartirss = ss.getSheetByName("VtaCompartida");

Error (log):

TypeError: ss.getSheetByName is not a function
at [unknown function](Logica:2:23)

Thanks in advance!

2 Answers

I read earlier on the Reddit apps script forum about this same issue happening to them. Users there reported that unchecking "Enable Chrome V8 runtime" fixed their problem.

Related