Hi there,
Thank you for reaching out to us.
You were right. The getRange method is under the Sheet class. You encountered the error (Cannot find method getRange(number,number,number,number)) because sheet variable is not a sheet object rather a Spreadsheet object which is returned from the openByUrl method.
You can try the following sample below:
var ws = SpreadsheetApp.openByUrl(SPREADSHEET_URL); var sheet = ws.getActiveSheet(); var rangeValues = sheet.getRange(1, 1, sheet.getLastRow(), sheet.getLastColumn()).getValues();
Regards,
|
||||||