I have a very simply code;
function onEdit(e){
var ss = e.source.getActiveSheet();
ss.getRange(1,1).setValue(89);
}
When I run this, I get the error message
"TypeError: Cannot read property 'source' of undefined (line 3, file "Code")"
However, the code does, what it is supposed to do, that is, it works. I go on to the spreadsheet, type anything anywhere, and get 89 on the cell A1.
Why the error and how to make sure I don't get one?