TypeError: Cannot call method "getActiveSheet" of null
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("D2").setValue(99)
Please look into the screenshot All i want to set the value into the sheet with given range.
Here is the code
function myF() {
var app = SpreadsheetApp;
var g_as = app.getActiveSpreadsheet();
var as = g_as.getActiveSheet();
as.getRange("D2").setValue(99);
}
I did this and it works. The Logger comes back with the word Range. I had no expectation that it would come back with anything.
It changes O19 to 99 every time.
Whenever I start getting weird stuff going on I shut down the browser and come back up and that generally does the trick.