Unfortunately, it is not possible to disable copy / download for editors.
You can only do that for commenters and viewers.
As a workaround, I would advice you to keep your sensitive information into one master file and then importrange or copy via a script the shareable information into another file. So even if they copy or download the latter your sensitive information won't be copied / downloaded.
Related questions:
Thanks for the reply Marios. It's actually the code and functionality I want to protect. I guess I could set up a library and put some of the functionality away from the front end.
Commented Nov 30, 2020 at 10:29that's even simpler then. Do exactly as my suggestion. Have a master file with all the formulas and code, and use an importrange to get that information into another file that you are going to share. So the functionality and the code won't be visible to anyone but you and the second file will contain the frontend or the information you want to provide. If you want them to edit also the secondary file, then am afraid you need a script to regularly copy the values (not formulas) from the master spreadsheet to the secondary one. Let me know what you think. @michaeldon
Commented Nov 30, 2020 at 10:36Yes it's only the scripts that I need to hide as that's where all the processing happens. You could attach a script to a front end sheet that triggers a script in the back end sheet through a Web App, and you could import the results into the front end using Importrange. It's a bit of a mess though :)
Commented Nov 30, 2020 at 11:30Hi Mario, thank you very much, I give a bounty to @TheMaster, but I'm still grateful for your work. Here's a related Q: stackoverflow.com/questions/63275687/…. And I've made my own research. Basically, your idea is correct at the moment, but I hope Google would provide an Admin role to sheets, so editors won't have all Admin permissions. Thanks again and sorry for awarding another answer!
Commented Nov 16, 2021 at 7:54I think the simplest solution would be to copy and paste from the master file the range of values you want to share with the other document. In this scenario the editors of the other document won't have access to neither the code nor the full data of the master file since the latter won't be shared with them.
The copy and paste part can be done automatically via a script and a trigger mechanism to update the data automatically so you won't have to do anything manually and the master file won't be exposed to any user.
answered Nov 14, 2021 at 19:30 27.2k 8 8 gold badges 38 38 silver badges 58 58 bronze badgesThere isn't any sure way to hide your data. Once something is published on the internet, you should consider it saved on many devices all over the world. Consider some ways to get hidden spreadsheet data
Data may be hidden from naive users. Data cannot be hidden from users, who know the basics of how the web works.
You may still be able to hide logic of your code.
Create a script onOpen to kill sheets if the file is wrong?
onOpen cannot post data anywhere without the new copy owner permission. It's not possible to kill sheets. But data can be erased.
/** * Deletes all sheets on the copy, if a copy is made */ const onOpen = () => < const ss = SpreadsheetApp.getActive(); const const sheets = ss.getSheets(); ss.insertSheet(sheets.length);//insert a blank sheet at the end if (id !== '###Original ID###') sheets.forEach(s =>ss.deleteSheet(s));//will fail at the last sheet(doesn't matter) >;
But editor can modify the original script before making a copy. And a revision of the original spreadsheet will still be available. The new owner can revert to the original version, use api endpoints mentioned above to get the data. Also mobile apps don't support onOpen . New owners can simply use mobile versions to access data.
Use formula web-app to notify file owner, ?
Possible, but data is already copied and there's no specific information that can be used to accurately identify the new owner. You maybe able to get locale information though.