Is there a way to move a NON active google sheet to a specific position or to insert it into a specific position with Google App Script.
Yes I could make it the active sheet and move it that way I am aware but I want to avoid that! This is the documentation that I can find on that: https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#moveActiveSheet(Integer)
The issue is that because the script programmatically creates the sheet, names it and fills in a bunch of data I do not want to have to make it the active sheet. It seems needless to make the sheet the active sheet just so that I can move its position to where I want it. At no point do I ever call ActiveSheet in the entire script and would like to keep it that way.
If there is a way please let me know! I am afraid that the answer is going to be no as I cannot find a way to do it.
This is the code that I am using to create a sheet but have no way to move it around:
var sheet = SpreadsheetApp.openById('MySheetIDHere')
var tempsheet = sheet.getSheetByName('SheetTemp');
tempsheet.copyTo(sheet).setName('New Sheet Name');