We are using Drive Api and a Google Service Account to programmatically duplicate spreadsheets. Each new spreadsheet is set with custom metadata and references a Apps Script/Cloud Platform Project as a Library.<p>We keep running into Apps Script errors "Server error occurred. Please try saving the project again." when the duplicated spreadsheet tries to run `onOpen(e)` on its own bound script.<p>According to Ryan at Google [1]
the workaround is to create an Add-on because Service Accounts are not allowed to execute scripts.
This Stackoverflow poster also came to the same conclusion [2].<p>Add-on could be a good workaround. If you have experience with it, what are some tricky elements to watch out for? Which online resources have you found helpful?<p>[1] https://issuetracker.google.com/issues/36762799
[2] https://stackoverflow.com/questions/43909670/google-appsscript-and-drive-api-v2-change-google-platform-project-programmatic