What I am trying to do is make a copy of a template doc, the append sheet data to the new file. I am using the doc URL as the id. However, when I try to access the file I am getting this error "Document is missing (perhaps it was deleted?) (line 21)" Line 21 is
var templateid = "URL";
var file = DocumentApp.openById(templateid);
Can anyone advise on what the problem could be?