Search code examples
google-apps-scriptgoogle-sheetspassword-protectiongoogle-workspace

Password Protection for Exported Data from Google Sheet


I saved my data Google Sheet, I can limit access to this data with Sharing feature available at all Google Docs (Sheet). Is there any solution for me to protect exported document from Google Docs (and Sheet)?.

What I can think of right now, password protection on file level as we can found at Microsoft Excel file. I am okay if I need to do some coding in Google Script found at GSuite.


Solution

  • Answer:

    Unfortunately there is no way of programmatically setting a password of an exported Drive File.

    More Information:

    The only programmatic export method of the G Suite APIs is the Files: export method of the Drive API. This end point does not have a way of setting a password to protect the exported file.

    Exported files also can not be of a Google Drive File MIME Type and so you can not set a password like one would be able to using the Protect File menu item for web-app deployed Sheet.

    This is therefore, sadly, impossible to do. The password protection would have to be set manually on the host machine after export.

    References: