I had some code created using the classic editor that did the job of inserting 10 lines in two Google Sheets, which grow down over time with record building. The code speeded things up for the users. But, it quit working properly. I Spent about 6 hours researching and learning how to do vague trial and erroring testing with no success. I upgraded to the new editor. It took about 12 hours to lean the new interface and rewrite to speed the new macro up using the things that I have learned over the last few years with Google Script and Sheets. Adapted macro to two sheets (Amazon and eBay) to be fully automated, but I've run into a road block on the second to last line (a line of the original code) with an error (above) using the new editor . I'm under a deadline and trying to get Amazon working again first. I've just finished proving to myself where the roadblock is. I did find one reference that indicated I may need to load and API. But, Google searches aren't coming up with the same find.
function Insert_One_Row(){
var ss = SpreadsheetApp.getActive(); //"spreadsheet"/Spreadsheet
logger.log(ss);
var as = SpreadsheetApp.getActiveSpreadsheet(); //"sheet"/Sheet/activesheet
Logger.log(as);
var asn= ss.getName(); //"sheet"?/activesheetname
Logger.log(asn);
var ac = ss.getCurrentCell(); //currentCell/activecell
Logger.log(ac);
var arw= ac.getRow(); //activeRow
Logger.log(arw);
var arg= ss.getActiveRange(); //activeRange
Logger.log(arg);
}
if(asn = 'Amazon'){
nr.activate();
var Spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); //for ReferenceError: ss
//was not defined below
var Sheet = SpreadsheetApp.getActiveSpreadsheet(); //for ReferenceError: ss was not
//defined below
//Errored on SS
Logger.log(Spreadsheet);
Sheet.getRange(Spreadsheet.getCurrentCell().getRow() -2, 1, 1, Sheet.getMaxColumns()).activate();
Insert_Row();
}