WebSetting a script up for the first time and copying and pasting from another script that is functioning properly. I'm trying to import specific email attachments into a Google Sheet. WebIn the new sheet it's giving me the error: " TypeError: Cannot read property 'getActiveCell' of null " var ws = SpreadsheetApp.getActiveSpreadsheet ().getSheetByName ("TimeSheet Sergei"); function onEdit (e) { var activeCell = ws.getActiveCell (); var col = activeCell.getColumn (); var row = activeCell.getRow ();
TypeError: Cannot read property
WebAdd a comment 2 Answers Sorted by: 1 Cannot read property 'getLastRow' means that sheet.getLastRow () does not exist The reason is sheet is defined wrongly. For example if you specify var sheet = ss.getSheets () [1]; while your spreadsheet has less than 2 sheets or var sheet = ss.getSheets ().getSheetByName ("WRONG NAME");, WebIn this line below all the elements are null, therefore, that's the reason you are getting the TypeError: Cannot read property 'getSheetName' of undefined error message. for ( [i, … green caterpillar with horn on end
Getting the following TypeError: Cannot read property …
WebMar 20, 2024 · TypeError: Cannot read property 'getNumSheets' of null(行 4、ファイル「コード」) というエラーが表示されます。 該当のソースコード WebMar 2, 2024 · Spreadsheet — This spreadsheet, for chaining. Authorization Scripts that use this method require authorization with one or more of the following scopes:... WebApr 25, 2024 · 1 Answer Sorted by: 1 The "active" methods, like getActiveSpreadsheet (), return null when the script is triggered by a time-driven trigger. You should replace this by openById ('yourSpreadsheetId') / openByUrl ('yourSpreadsheetUrl') methods. Share Improve this answer Follow edited Jun 1, 2024 at 5:49 Antoine Colson 103 3 green caterpillar with brown back