Sub topic 8
What protection does not do
This chapter assumes you can protect a range or sheet from Data > Protect sheets and ranges. It also assumes you know the file access levels (viewer, commenter, editor, owner) and can read short Apps Script snippets. Earlier chapters showed what protection blocks. This chapter covers what it leaves open, so you don't rely on it for guarantees it can't give.
The one-sentence model
Protection restricts who can type into, paste over, or clear certain cells among people who already have edit access to the file. It is an editing guardrail. It is not a confidentiality control and not a defense against a determined editor.
Two consequences follow:
- Protection never grants access. Someone who can't edit the file can't edit protected cells either, and protection doesn't change that.
- Protection never hides anything. Anyone who can open the file can read every protected cell.
What protection does and does not cover
| Concern | Does protection handle it? |
|---|---|
| A collaborator accidentally overwrites a formula | Yes. Editors not on the protection's list are blocked. |
| A collaborator should be reminded to be careful | Yes, with warning-only protection. |
| A viewer reads a protected cell | No. Protected cells are fully readable. |
| An editor copies the data elsewhere | No. |
| The file owner changes a protected range | No. The owner can always edit and remove protections. |
| A protected formula recalculates after its inputs change | Yes, it recalculates. Protection blocks direct edits, not recalculation. |
| A person on the protection's editor list removes it | No. They have full control over it. |
| Someone restores earlier content from version history | Not reliably. Treat history as a separate exposure. |
Protection does not hide data
The most common wrong assumption is that a protected cell is a private cell. Protection controls writing. Reading is controlled only by the file's sharing settings.
Suppose a sheet named Salaries is protected so only HR can edit it. Every person with at least view access to the spreadsheet can still open that tab and read every value. They can also see the protection's description, and anyone who can edit the file can see who is on the editor list.
Hiding a sheet doesn't fix this. A hidden sheet is only tucked away. Anyone with edit access can unhide it from the sheet list. Viewers can't unhide it, but formulas, charts, and exports can still expose its contents, and a file copy includes it.
If some people must not see certain data, that data does not belong in a file they can open. Separate files are the dependable answer, covered below.
Protection does not stop copying
Reading implies copying. A person who can see a range can usually do the following:
- Select the cells, copy them, and paste them into another spreadsheet, a document, or a chat message.
- Use File > Download to get a local copy in Excel, CSV, or PDF form.
- Use File > Make a copy, which creates a new spreadsheet owned by the person who copied it. They are the owner of that copy, so they control any protections inside it and can delete them.
The file owner can reduce some of this. The Share dialog has a setting that stops viewers and commenters from downloading, printing, and copying. This is a sharing setting, not a protection. It applies to viewers and commenters, not to editors, and it can't stop someone photographing a screen. It reduces casual copying and nothing more.
Editors have more options still. They can copy a whole tab into another spreadsheet they own. The data arrives in a file whose protections they control.
Authority comes from the file, not the cell
Protection is layered on top of file access, and the layers have a fixed order:
- The file owner has full control, including every protection.
- People on a protection's editor list can edit that protected range or sheet. In the interface, that includes changing or removing the protection.
- Other file editors are blocked from the protected cells, but they remain editors of everything else.
- Commenters and viewers can't edit anything.
Two practical points come from this order.
First, the owner is never restricted. If a tutorial author, manager, or team lead owns the file, they can overwrite protected data, so the protection mainly constrains everyone else. If you need the file's real owner to be trustworthy, choose the owner deliberately.
Second, anyone whose file access you can't fully trust can undermine the scheme. An editor who is not on the protection's list can't type into the range. They can often still make a copy of the file or the tab, and an editor with sharing rights can add new people to the file. Protection doesn't constrain those actions.
Warning-only protection does not block anything
Warning-only protection shows a confirmation prompt (something like "Are you sure you want to edit this part of the spreadsheet?"). If the person clicks through, the edit happens. Use it to discourage accidents, for example on a calculated column. Don't use it when an edit would cause real harm, because it can't prevent that edit.
This is easy to get wrong during an audit: a range that appears in the protection list is not necessarily blocking anyone. Check each entry's warning-only flag.
Formulas and recalculation still run
Protecting a cell containing =SUM(B2:B20) stops people from overwriting that formula. It doesn't freeze its result. When someone edits an unprotected input in B2:B20, the protected formula recalculates, as it should.
This matters in both directions:
- You can safely protect formula cells and leave inputs open. This is the standard pattern.
- You can't use protection to freeze a value. If you need a snapshot that never changes, paste values only, or keep the number in a file nobody else edits.
Protection also doesn't validate input. If an unprotected input accepts text where a number is expected, the formulas downstream break. Use data validation on input cells together with protection.
Scripts and the API act with someone's authority
Apps Script and the Sheets API don't bypass protection by themselves. They act as the account that runs them. That has two sides:
- A script run by an editor who is not on a protection's list can't write to that range. It fails the same way a manual edit would.
- A script that runs as the owner, or as a user on the list, can write to it. This includes installable triggers and web apps that execute as the owner, and API calls made with the owner's credentials.
When you review a scheme, include automation. A script that runs as the owner is a trusted path around your protections. Anyone who can edit that script, or who can trigger it with input they control, effectively borrows the owner's authority.
Also note that a protection stores a list of users. Adding someone to the file with edit access doesn't add them to a protection, and removing them from the file removes their access everywhere. Protection lists are not groups that follow people across files.
Version history and other side doors
Several features expose content outside the protected cells:
- Version history shows earlier states of the file to people who can open it with edit access. If a value was sensitive and later removed, it may still be viewable there.
- Charts, pivot tables, and formulas in unprotected cells can display protected values, because reading is allowed.
- IMPORTRANGE lets another spreadsheet read data from this one, as long as the person who creates the link has access to the source. The data then lives in a file with its own protections.
- Published links (File > Share > Publish to web) expose content to anyone with the link, regardless of protection.
None of these are bugs. They follow from the rule that protection controls writing, not reading.
What to use when protection is not enough
| Goal | Better approach |
|---|---|
| Keep data private from some collaborators | Keep it in a separate spreadsheet shared only with the people who need it. |
| Let many people view results without seeing source data | Share a summary file that holds values or an IMPORTRANGE pull of selected cells, with source data in a restricted file. |
| Stop editors from altering a fixed reference table | Put it in a view-only file and pull it in with IMPORTRANGE. |
| Collect input from many people without exposing others' answers | Use Google Forms or an Apps Script web app that writes to a sheet only the owner can open. |
| Keep a record of changes | Combine protection with version history review and, for important files, scheduled copies. |
| Prevent accidental overwrites | Protection (editor list or warning-only) is the right tool. |
The pattern is the same each time. If the risk is a mistake by a trusted collaborator, protection works. If the risk is a person who shouldn't see or take the data, change who has access.
Auditing for gaps with Apps Script
Earlier chapters listed protections. This script goes one step further and flags entries that don't enforce anything. It reports warning-only protections and protections that allow domain-wide editing.
function auditProtectionGaps() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
ss.getSheets().forEach(sheet => {
const protections = sheet
.getProtections(SpreadsheetApp.ProtectionType.RANGE)
.concat(sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET));
protections.forEach(p => {
let issue = null;
if (p.isWarningOnly()) {
issue = 'warning only: does not block edits';
} else if (p.canDomainEdit()) {
issue = 'domain edit enabled: wider than the editor list';
}
if (issue) {
Logger.log('%s | %s | %s | %s',
sheet.getName(),
p.getRange().getA1Notation(),
p.getDescription() || '(no description)',
issue);
}
});
});
}Run it from the Apps Script editor and read the output under Execution log. An empty log means no entry matched, not that your scheme is safe. The script can't tell you who has read access, whether copies exist, or who owns the file.
Checklist before you rely on a protection
- Name the risk. Is it an accidental edit by a trusted person, or access by someone who shouldn't have it?
- For accidental edits, choose block or warn. Block when the edit would cause harm, warn when it merely deserves a second look.
- For access risks, don't use protection. Change the sharing, split the file, or publish values elsewhere.
- List who is the owner and who has edit rights to the file, and note that each of them can bypass or remove the protection.
- Review scripts, triggers, and API credentials that run as an authorized user.
- Re-run an audit after people join or leave the file.
Exercise
A team lead protects the "Payroll" tab so that only she can edit it, then shares the spreadsheet with the whole team as editors so they can fill in the "Hours" tab. She is told that this keeps payroll figures confidential. Is that true? Name two ways a teammate could still get the payroll figures, and say what she should do instead.
Show answer
It isn't true. Protection blocks editing only, so every teammate can open the Payroll tab and read it. A teammate could copy the cells and paste them into another file, or use File > Download or Make a copy to get the whole workbook. The tab could also be exposed through a chart or formula elsewhere, or through version history. To keep the figures confidential, she should move Payroll into a separate spreadsheet shared only with the people who need it. If the team needs a total, she can pull just that value into the shared file with IMPORTRANGE or paste it as a value.