I am trying to use the script below, but am getting the error below. Can anyone. help me understand what I am doing incorrectly? Much appreciated!
Script:
function createNewGoogleDocs(){
const googleDocTemplate = DriveApp.getFileById('1dCzNrne3JrnOusk6haDJsnNqbv558fY6YBRCnvE5tDE');
const destinationFolder = DriveApp.getFolderById('16BWlpECwn6qfZgqj3UficlaGfMTKdaat');
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetbyName('Data');
const rows = sheet.getDataRange().getValues();
Error:
TypeError: SpreadsheetApp.getActiveSpreadsheet(...).getSheetbyName is not a function