I am trying to build a data logging workflow using Sheets. I've got a getValue/setValue pair that looks great, but isn't writing to the target cell, and I can't understand why. Here's the code I'm using:
function TESTcopy() {
var srcSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var srcSht = srcSpreadsheet.getSheets()[0];
var tgtSpreadsheet = SpreadsheetApp.openById('1xjjXG-tK3DIkgJTQbkR6XFhOEP5nhaNfqqXiFyMu0AY');
var tgtSht = tgtSpreadsheet.getSheets()[0];
var data = srcSht.getRange(4,2,20,18).getValues();
tgtSht.getRange(345,5,20,18).setValues(data);
}
I've gone over the entire script letter-by-letter, and have Googled and searched on SO for several hours. I know that there's a simple explanation, but I just can't see it.
Does anybody else have any ideas? Thanks in advance!