简体   繁体   中英

Google Apps Script Errors all of a sudden?

I am receiving the following error that have started out of the blue. I do not know how to resolve of fix them. These are for Import Range functionality and have been working fine until now...

Error Spreadsheet X:

TypeError: Cannot call method "getRange" of null. (line 3, file "Code")

Script:

var values = SpreadsheetApp.openById('1ka0MPaC1xXcu4EAbmSjc9c7BJyNDwOpggBkix2qMBxY').
getSheetByName('Overtime Activities (Do not edit)').getRange('i3:m1000').getValues();
SpreadsheetApp.getActive().getSheetByName('Form responses 1').
getRange(1,8,values.length,values[0].length).setValues(values);
function timeDriven(e) {
if( e !== undefined )
errorHandling_(monitor_,true);
}

Error Spreadsheet Y:

TypeError: Cannot call method "getRange" of null. (line 6, file "Code")

Script:

var values = SpreadsheetApp.openById('1MJ7D7vOWWPgJBO5MZtZHyPw6Iw0kNlZ8Y5OIwSdzBUg').
getSheetByName('Form responses 1').getRange('a:F').getValues();
SpreadsheetApp.getActive().getSheetByName('Overtime Activities (Do not edit)').
getRange(3,1,values.length,values[0].length).setValues(values);
function timeDriven(e) {
if( e !== undefined )
errorHandling_(monitor_,true);
}

Please help! :)

Extra spacing when renaming sheet threw everything out. Thank you Serge for continuing to point this out! Issue fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM