I seem to be encountering an issue with this particular script where it consistently generates the error mentioned in the title.
Title: cell.setHorizontalAlignment(SpreadsheetApp.HorizontalAlignment.CENTER)
function CustomFont() {
//
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var currentSheet = spreadsheet.getSheets()[0];
var targetRange = currentSheet.getRange('B2:D1004');
targetRange.setFontWeight('bold');
targetRange.setFontColor('#000000')
targetRange.setFontSize(10)
targetRange.setHorizontalAlignment(SpreadsheetApp.HorizontalAlignment.CENTER)
}
Appreciate your assistance!