Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Google Script Negative Offset ERROR (The starting column of the range is too small.)

$
0
0

Below is a script I got online, this sends an email if anything was changed in column O, part of the subject line is the value on column D, so I am using offset(0, -12).getValue() to get the value, but I am having The starting column of the range is too small. error, can someone help me with this please?

function NewEmailRev() {

  var sSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("LATEST"); 

 var lastRow = sSheet.getLastRow();

var ss = SpreadsheetApp.getActiveSpreadsheet();
var cellValue = ss.getActiveSheet().getActiveRange().getA1Notation();
var dateRTG = new Date();  
var getColumn = ss.getActiveSheet().getActiveRange().getColumn();
var sheetname = ss.getActiveSheet().getName();
var user = Session.getActiveUser().getEmail();
var Toemail = 'myEmail@testing.com';

var body = 'Status was changed to ' +ss.getActiveCell().offset(0, 0).getValue()+ ' by ' + user + "\n" + 'on - '+ dateRTG;

var subject = 'Status Update Notification - '+ ss.getActiveCell().offset(0, -12).getValue() ;


if(user !='ignorethis@email.com'&& Number(ss.getActiveCell().getValue()!= "Nothing") && getColumn ==15) {

MailApp.sendEmail(Toemail,subject, body);

}

};

Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>