当单元格中的总支出超过一定数量并且我收到
TypeError: Cannot read property 'getValue' of null Checktotalspend @ Code.gs:6时,我正在尝试使用 Google 表格中的 appscript 发送电子邮件
function Checktotalspend() {
// Fetch the total spend number
var ss= SpreadsheetApp.getActiveSpreadsheet();
var spendsheet= ss.getSheetByName("mSOWProjects");
var spendtotal = spendsheet.getValue("P1");
// Check total spend
//if (spendtotal > 100000){
// Fetch the email address
// var emailRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Summary").getRange("A49");
//var emailAddress = emailRange.getValues();
// Send Alert Email.
//var message = 'The total spend is ' + spendtotal; // Second column
// var subject = 'Tier 1';
//MailApp.sendEmail(emailAddress, subject, message);
// }
}