Instead of just
var sheet = SpreadsheetApp.getActiveSpreadsheet();
do this
var spread = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spread.getSheets()[0];
’nuff said.
Instead of just
var sheet = SpreadsheetApp.getActiveSpreadsheet();
do this
var spread = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spread.getSheets()[0];
’nuff said.