I want to know if I can make a copy of an existing Spreadsheet through script, but without copying its original script.
I have an yearly spreadsheet that manages all the co-worker's salary. At the end of the year, I want to make a copy of the spreadsheet just to save the data for that year. I will be reusing the original spreadsheet for next year.
So I made a script that creates a new copy of the original spreadsheet. I executed the script then opened script editor, but there was the same script which was also embedded in original spreadsheet.
SpreadsheetApp.getActiveSpreadsheet().copy();
This is what I have written on the script. What should I do to copy spreadsheet only?
getActiveSpreadsheet().getSheets()
will give you an Array ofSheet
s, create a new spreadsheet, and for each sheet in the old one,sheet.copyTo(newSS)
– sinaraheneba