I wanted to print my Google spreadsheet with a button click and I tried different codes and finally tried the following code. But I am getting the following error.
TypeError: SpreadsheetApp.setPrintSettings is not a function
Would someone be able to help me resolve this?
function setPrintSettings() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var printSettings = {
orientation: 'landscape',
paperSize: 'letter',
scale: 100,
};
SpreadsheetApp.setPrintSettings(printSettings);
}