To password protect an Excel file so it cannot be opened without the password, go to File → Info → Protect Workbook → Encrypt with Password, enter and confirm a password, then save. That encrypts the whole workbook. The more familiar Protect Sheet and Protect Workbook buttons on the Review tab do something quite different: they only stop people changing cells or sheets, and anyone can still open the file and read every number in it.
This guide shows how to encrypt a workbook properly, what the other protection options are for, and how to share a protected spreadsheet.
How to encrypt an Excel workbook with a password
- Open the workbook in Excel for Windows.
- Click File, then Info.
- Click Protect Workbook and choose Encrypt with Password.
- Type a strong password and click OK, then type it again and click OK.
- Save the workbook. The protection applies once it is saved.
- Close it and reopen it to confirm the password prompt appears.
Current versions of Excel encrypt the workbook with AES, so with a long, unique password the data is well protected. Microsoft cannot recover or remove a forgotten password.
Setting separate open and modify passwords
If you want some people to view the workbook and others to edit it, use the Save As route:
- Choose File → Save As and pick a location.
- In the Save As dialog, click Tools → General Options.
- Enter a Password to open (this encrypts the file) and, if you like, a different Password to modify.
- Click OK, confirm the passwords, and save.
On its own, a password to modify does not encrypt anything. People without it can still open the workbook read-only and see all the data.
Protect Sheet and Protect Workbook are not encryption
These options on the Review tab are often mistaken for security features:
- Protect Sheet locks cells so they cannot be edited, while allowing chosen actions such as selecting or filtering. It is designed to stop accidental changes to formulas.
- Protect Workbook (on the Review tab) protects the structure, so sheets cannot be added, deleted, renamed or unhidden.
- Hidden sheets and hidden columns can be unhidden in seconds.
None of these encrypts the data. Anyone who opens the file can read and copy the contents, and the protection itself can be removed with readily available methods. Use them for keeping a template tidy, not for keeping salary data private.
| Option | Stops opening? | Stops reading? | Good for |
|---|---|---|---|
| Encrypt with Password | Yes | Yes | Confidential data |
| Password to modify | No | No | Controlling who saves changes |
| Protect Sheet | No | No | Protecting formulas and layout |
| Protect Workbook structure | No | No | Preventing sheet changes |
| Hide sheet or column | No | No | Tidiness only |
Things that change once a workbook is encrypted
- No co-authoring. Several people cannot edit an encrypted workbook at the same time in OneDrive or SharePoint.
- Excel in a browser may not open it. Recipients may need desktop Excel.
- Links between workbooks to an encrypted file ask for the password when they update.
- Power Query and other tools that read the file automatically may fail until you supply the password or remove it.
What about CSV files?
CSV is plain text and has no password feature at all. Exports from banking, payroll or customer systems often arrive as CSV and sit unprotected in the Downloads folder. You have two choices:
- Open the CSV in Excel, save it as an .xlsx workbook with Encrypt with Password, then securely delete the original CSV.
- Encrypt the CSV file itself with a file encryption tool, which keeps it as a CSV for the systems that need it.
Protecting lots of spreadsheets
Setting passwords one workbook at a time is fine for a handful of files. For a folder of payroll exports, client accounts or monthly reports, it is slow and easy to miss one. Document Key can encrypt a whole folder with AES-256 in one right-click, whatever the file types, and its watched folders feature encrypts new files saved into a folder automatically, which is handy for recurring exports. To open a file, you double-click it and enter your password.
The same thinking applies to documents: see how to password protect a Word document for Word's options.
Sharing a protected spreadsheet
An encrypted workbook can be emailed safely as long as the password goes separately, by text or phone. A few tips:
- Use a different password for each recipient or each send, so one leaked password does not expose everything.
- Strip out sheets the recipient does not need before encrypting. Hidden sheets travel with the file.
- If you are sending several files at once, bundle them into one encrypted package or AES-256 ZIP instead of protecting each.
Our guide to sending encrypted files by email covers attachment limits and blocked attachments.
Check for hidden data before you send
Workbooks often carry more than you can see on screen: hidden sheets with source data, comments and notes, personal details in the file properties, and old pivot table caches. Encryption keeps these from outsiders, but the recipient gets all of it. Before encrypting a workbook to share:
- Save a copy, since some removals cannot be undone.
- Go to File → Info → Check for Issues → Inspect Document.
- Click Inspect and review what it finds, including hidden rows, columns and worksheets.
- Click Remove All for anything that should not leave your office.
- Save, then apply Encrypt with Password.
For reports built from a larger master file, it is often safest to copy only the finished figures into a new workbook with Paste Special → Values, so no formulas, links or source data travel with it. Document Key's activity log can also help you keep track of which files were locked, opened and shared, and when.
Removing or changing the password
- Open the workbook with its current password.
- Go to File → Info → Protect Workbook → Encrypt with Password.
- Clear the box to remove the password, or type a new one.
- Click OK and save.
Forgotten passwords on encrypted workbooks are rarely recoverable. Save the password in a password manager when you set it. If it is already too late, see what you can do when you forget the password to an encrypted file.
Frequently asked questions
Does Protect Sheet stop people opening my Excel file?
No. Protect Sheet only stops changes to cells on that sheet. Anyone can still open the file and see the data. Use Encrypt with Password to require a password to open it.
Can I set a password to open and a different one to modify?
Yes. In Save As, choose Tools, General Options, and enter a Password to open and a Password to modify.
Can I password protect a CSV file?
No. CSV is plain text with no password feature. Save it as an Excel workbook with a password, or encrypt the CSV file with an encryption tool.
