How to Password-Protect an Excel File (2026)
Excel has five different kinds of password protection — and they don't all do what people think they do. This guide covers each one, how to set and remove them, which are actually secure, and what to do when you forget the password.
What's in this guide
The five levels of Excel protection
Before you click anything, understand what you're actually protecting. Excel has five distinct mechanisms, and only the first is real encryption. The others control specific behaviors within a file that anyone can already open.
| Type | Prevents | Security |
|---|---|---|
| Password to open | Opening the file at all | Strong (AES-256 encryption) |
| Password to modify | Saving changes to the file | Weak (bypassable by "Read Only") |
| Sheet protection | Editing cells on a specific sheet | Weak (accidental changes only) |
| Workbook structure | Adding, deleting, or reordering sheets | Weak |
| VBA project | Viewing or editing VBA code | Weak in older Excel; stronger in 2019+ |
If confidentiality matters — client data, financial records, contracts — use the opening password. Everything else is guidance for well-behaved users, not defense against attackers. Third-party tools can crack sheet and structure passwords in seconds.
Password to open (encryption)
This is the strongest option. Excel encrypts the entire file with AES-256 (in Excel 2013 and newer). Without the password, the file's contents are unreadable — even to Microsoft.
How to set it
- Open the file you want to protect
- File → Info
- Click Protect Workbook → Encrypt with Password
- Type a strong password → OK
- Type the same password again to confirm → OK
- Save the file (Ctrl+S)
From next open, Excel prompts for the password. Enter it correctly and the file opens; enter the wrong one and Excel simply refuses.
Alternative: Save As dialog
- File → Save As → Browse to your location
- Click Tools (bottom of the Save As dialog) → General Options
- Enter a password in the "Password to open" field → OK
- Confirm the password → OK
- Save
What "strong" means for the password
- 12+ characters minimum
- Mix of uppercase, lowercase, numbers, and symbols
- Not based on personal info (birthday, name, "password123")
- Not reused from other accounts
- Stored in a password manager — no exceptions
AES-256 is unbreakable in practice — but "myname2024" as the password is guessable in seconds by any dictionary-attack tool. A strong random password from a password manager is genuinely secure. A weak password isn't.
Password to modify
Lets anyone view the file but requires a password to save changes. Useful for reference documents where accidental edits would be a problem.
How to set it
- File → Save As → Browse
- Click Tools → General Options
- Enter a password in the "Password to modify" field → OK
- Confirm → OK
- Save
When the file opens, users see a dialog with three buttons: "Password", "Read Only", "Cancel". Clicking Read Only opens the file without needing the password. Users can then view everything, save as a copy under a different name, and edit that copy freely. The modify password prevents accidental overwrite, not access.
When to use it
- Templates you want people to fill out fresh copies of
- Reference sheets where the master should stay unchanged
- Shared workbooks where you're the owner and others review only
When not to
Don't use modify passwords as security. Sensitive data with just a modify password is effectively public — anyone can open, view, and re-save. Use the opening password instead.
Sheet protection
Locks specific cells on a specific sheet from editing. The workbook opens normally; individual sheets are read-only or partially editable based on your rules.
How it works: locked vs unlocked cells
Every cell in Excel has a "Locked" property (Format Cells → Protection tab). By default, all cells are locked — but the lock doesn't do anything until you turn on sheet protection.
The typical pattern:
- Select cells users should be able to edit (input fields, data-entry columns)
- Format Cells (Ctrl+1) → Protection tab → uncheck Locked → OK
- Review → Protect Sheet
- Optional: enter a password
- Choose what protected users are allowed to do (select cells, format columns, sort, autofilter, etc.)
- OK
Now the unlocked cells accept input; locked cells (everything you didn't unlock) refuse edits.
What sheet protection can prevent
Sheet protection blocks a specific set of actions. The Protect Sheet dialog lets you allow or deny each:
- Selecting locked cells (usually leave this on so users can still copy values)
- Formatting cells, columns, rows
- Inserting or deleting rows/columns
- Sorting
- Using AutoFilter
- Using PivotTables and PivotCharts
- Editing objects and scenarios
Unlock input cells (usually one column). Turn on Protect Sheet with "Select unlocked cells" allowed but no other permissions. Users tab through only the input cells and can't accidentally overwrite formulas, headers, or lookup tables.
Removing sheet protection
Review → Unprotect Sheet. Enter the password (if set). The sheet is now editable normally.
Sheet protection passwords use an old, weak hashing scheme. Free tools online can remove them in seconds. Never use sheet protection for confidentiality — only for preventing accidents.
Workbook structure protection
Prevents users from adding, deleting, hiding, unhiding, or reordering sheets. Also prevents renaming sheets. Useful for finished models where the sheet structure is part of the design.
How to set it
- Review → Protect Workbook
- Check Structure
- Optional: enter a password
- OK
What it does
- Insert Sheet: greyed out
- Delete Sheet: greyed out
- Rename Sheet: blocked
- Move/Copy Sheet: blocked
- Hide/Unhide Sheet: blocked
- Right-click sheet tab menu: most options greyed
What it doesn't do
Cell editing on the sheets is unaffected. Users can still change values, formulas, and formatting on any visible sheet — that's what sheet protection is for.
VBA project password
Prevents users from viewing or editing your VBA code in the editor. Useful when you've built macros you don't want others to modify or copy.
How to set it
- Open the VBA editor (Alt+F11)
- Tools → VBAProject Properties
- Protection tab
- Check Lock project for viewing
- Enter password and confirm
- OK
- Save and close the workbook
- On next open, VBA code is hidden until password is entered
VBA project passwords in .xls (Excel 97-2003) and older versions can be removed with a hex editor in minutes. Modern .xlsm files use stronger protection but still shouldn't be relied on for real IP protection. If your macros are truly proprietary, consider distributing as an .xlam add-in with the code compiled or as a COM add-in.
Removing passwords
Remove opening password
- Open the file with the current password
- File → Info → Protect Workbook → Encrypt with Password
- Clear the password field (delete the dots)
- OK
- Save
Remove modify password
- Open normally (with the modify password, or Read Only + Save As if you don't have it)
- File → Save As → Tools → General Options
- Clear the "Password to modify" field → OK
- Save
Remove sheet protection
- Review → Unprotect Sheet
- Enter password
- Sheet is unlocked
Remove workbook structure protection
- Review → Protect Workbook (button acts as toggle)
- Enter password if set
- Structure protection is off
Remove VBA password
- Alt+F11 to open VBA editor
- Enter the password when prompted
- Tools → VBAProject Properties → Protection tab
- Uncheck "Lock project for viewing"
- Clear the password fields
- OK, then save the workbook
If you forget the password
Opening password (strong protection)
There is no legitimate way to recover a forgotten opening password on modern Excel. Microsoft does not have a master key. AES-256 with a strong password is designed to be unrecoverable.
Third-party "password recovery" tools exist. They work by brute-forcing common passwords or dictionary attacks — effective against weak passwords but useless against strong ones. Reputable options include Passware, PassFab, and iSunshare. Expect success only if:
- The password is short (under 8 characters)
- The password is a common word or predictable pattern
- You remember partial information (starts with, length, character types)
If the file was created in Excel 2010 or earlier and never re-saved in a newer version, the encryption is weaker and recovery is more feasible.
Sheet, structure, and VBA passwords (weak protection)
These are usually recoverable, since the protection is not real encryption. Third-party tools remove them reliably. For non-sensitive scenarios (you protected a sheet years ago and forgot the password), online tools work.
Uploading a business file to an unknown online password remover is a data leak in itself. If the file contains anything sensitive, use offline tools with a reputable vendor — not free web utilities that keep a copy on their server.
Best practices
Store passwords in a password manager
1Password, Bitwarden, KeePass, and similar tools generate strong random passwords and remember them for you. Never write passwords in the file's own metadata, filename, or a "Passwords.txt" next to it.
Match the protection to the threat
- Confidential data leaving your organization: Opening password + strong random password
- Template that shouldn't be overwritten: Modify password
- Data-entry form for coworkers: Sheet protection (no password needed)
- Finished model with fixed structure: Workbook structure protection
Test the protection before sharing
Close the file. Open it with a wrong password. Confirm Excel refuses. Open with the correct password. Confirm it opens. Sounds obvious but the "I set a password but forgot to save" mistake is common.
Combine encryption with other measures for real security
- Send passwords out-of-band (SMS or a different email account, not with the file)
- Use SharePoint or OneDrive permissions instead of file-level passwords when possible — better audit trails and easier revocation
- For truly sensitive data, use dedicated secure sharing tools (Firmex, Datasite) rather than passworded Excel files
Document what's protected
Keep a "Notes" sheet listing which sheets are protected and why. Six months later, you or a colleague will thank you.
Google Sheets equivalent
Google Sheets doesn't have file-level passwords — access is controlled by Google account permissions instead. You share with specific people or restricted groups; nobody outside that list can open the file at all.
For within-sheet protection, use Data → Protect sheets and ranges. Similar to Excel's sheet protection: mark ranges as editable only by specific users. Because Google Sheets identifies users by account, this is stronger than Excel's password model — no password to share, no password to leak.
Downsides: requires everyone to have a Google account, and works only inside the Google ecosystem. Downloaded copies (as .xlsx or PDF) have no protection at all.
Common pitfalls
Defeats the purpose entirely. If your inbox is compromised, both go together. Send the password via a different channel — text, phone call, encrypted messenger.
It isn't. Anyone determined can strip it. Sheet protection stops honest mistakes, not adversaries.
One leaked file becomes a master key to all the others. Unique password per file, stored in a password manager.
The Protection tab has two options: password + Lock. Setting only the password without checking Lock does nothing — anyone can still open the code. Always check both boxes.
If you keep multiple copies (backup, prior version), the passwords may differ. When rotating passwords, update every copy and delete stale ones.
Set up the right protection scheme in one step
Deciding which cells to lock, which sheets to protect, and which permissions to allow gets fiddly on complex models. Excel Wizard analyzes your workbook — identifies inputs vs formulas, headers vs data — and applies a coherent protection scheme in one operation.
Install Excel Wizard →Frequently asked questions
How do I password protect an Excel file to open?
File → Info → Protect Workbook → Encrypt with Password. Enter a strong password, confirm, save. Uses AES-256 in modern Excel — genuinely strong.
What's the difference between opening password and modify password?
Opening password encrypts the file; modify password only prevents saving over it. Modify is easily bypassed with the Read Only button — not real security.
How do I remove a password from an Excel file?
Open the file, File → Info → Protect Workbook → Encrypt with Password → clear the field → OK → save. For sheets or structure, use Review → Unprotect.
What happens if I forget my Excel password?
Opening passwords with strong encryption are essentially unrecoverable. Sheet and structure passwords can be removed with third-party tools. Always use a password manager.
Is Excel password protection safe?
Opening-password encryption in Excel 2013+ is strong (AES-256). Sheet, structure, and VBA passwords are weak — meant to prevent accidents, not attacks.