I have a code that creates a copy of the master sheet and saves it in a particular folder.
The reason for this is so that the person accessing the sheet does not mess up the main sheet but rather edits their own copy.
My code only creates the copy, but am at a loss at the point where a user will need to open their saved copy and edit it. This should happen automatically when the master sheet is opened. I will appreciate help on this.
Here is my code:
function onOpen(e){
var Book = SpreadsheetApp.openById(PCDF_sheet_id);
var Tab = Book.getSheetByName(PCDF_tab_name);
var PCDF_Data = Tab.getDataRange().getValues();
var user = Session.getEffectiveUser().getUsername();
var dest = DriveApp.getFolderById(Copy_Folder_id);
var name = Book.getName()+ user + " Copy ";
var newfile = DriveApp.getFileById(Book.getId()).makeCopy(name,dest);
var newSpreadsheet = SpreadsheetApp.open(newfile);
SpreadsheetApp.setActiveSpreadsheet(newSpreadsheet)
}