Last updated on November 17th, 2026 at 03:15 pm
Excel locks a workbook behind a password from File > Info > Protect Workbook > Encrypt with Password. Type a password, select OK, type it again, select OK, then save and close the file. Excel asks for the password every time it opens.
Write the password down first, because Microsoft can’t recover it and losing it locks you out of the file. Windows users of Excel for Microsoft 365, 2024, 2021 and 2019 can follow along; Mac and web notes come later.
Add a password to open the workbook
- Open the workbook and select File.
- Select Info.
- Select Protect Workbook, then Encrypt with Password.
- Type a password and select OK. Passwords are case-sensitive.
- Type the same password again and select OK.
- Save the workbook (Ctrl + S) and close it.

The Protect Workbook box turns yellow and shows that a password is required to open this workbook. Open the file again to check that Excel asks for the password. Word has a similar setting, and you can password protect a Word doc from File, Info, Protect Document in the Word desktop app.
Use a long password that’s hard to guess, such as a short phrase, and don’t reuse one from your email or bank. If the file will also be opened on a Mac, keep it to 15 characters or fewer, because Excel for Mac can’t open a workbook whose password is longer than that. A password manager is a good place to store it.
Let people open it but not change it
If you want others to read the file but only let people with a password edit it:
- Select File > Save As, then More options (or Browse).
- In the Save As window, select Tools > General Options.
- Type a password in Password to modify. Leave Password to open blank, or fill it in too if you want both.
- Select OK, confirm the password, and select Save.
Anyone without the modify password can still open the file as Read Only. You can also check Read-only recommended to suggest opening it read-only without a password. This is a light safeguard, not real security, because people can save a copy under a new name and edit that. Received a workbook like this and need to edit it? Changing read-only mode in Excel walks through it.
Remove the password
- Open the workbook with its password.
- Select File > Info > Protect Workbook > Encrypt with Password.
- Delete the dots in the Password box so it’s empty, and select OK.
- Save the workbook.
To remove a password to modify, open File > Save As > More options, select Tools > General Options, clear the Password to modify box, select OK, and save over the file.
Password to open vs. protecting a sheet
- Encrypt with Password stops anyone without the password from opening the file at all. The contents are encrypted.
- Protect Sheet (on the Review tab) stops people changing locked cells. Anyone can still open and read the file.
- Protect Workbook (on the Review tab) stops people adding, deleting, renaming, or moving sheets. It doesn’t stop anyone opening the file.
Does this also protect a CSV file?
No. Only Excel workbook formats such as .xlsx can be encrypted. A CSV file saves as plain text with no password.
The full set of protection options is in Protect an Excel file on Microsoft Support. Want to lock a whole folder instead of one workbook? Try password protecting a folder in Windows 10, or share the Excel file as a link with only the people who need it.
On a Mac or in Excel for the web
- Excel for Mac: select File > Passwords, type a Password to open, and select OK. Confirm it and save the file.
- Excel for the web: you can’t add a password to open, because there’s no Encrypt with Password option. If the browser won’t open a file that already has one, select Open in Desktop App or download the file and open it in Excel.
Encrypted workbooks also can’t be co-authored, so other people can’t edit them with you at the same time. For shared work, limit access with OneDrive or SharePoint sharing instead. Be careful if the file ends up in Google Drive: choosing Edit when you open a password-protected Excel file in Google Sheets removes the password for everyone.
Is a password-protected Excel file secure enough for sensitive data?
It’s strong for keeping people out of a file you email or store, as long as the password is long and shared separately, such as by phone. For ongoing sharing inside a team, OneDrive or SharePoint permissions are easier to manage.
If the password isn’t working
Excel doesn’t ask for the password when you reopen the file
The password only takes effect after you save. Add it, press Ctrl + S, close the workbook, and open it again. If you used Save As to make a copy, the password is on the copy, not the original.
Excel rejects the password as wrong
Passwords are case-sensitive, so check that Caps Lock is off and that you’re not typing a number-pad digit with Num Lock off. Excel doesn’t show hints or let you reset the password, so if it still fails, you’ll need a backup copy saved before the password was added.
Encrypt with Password is grayed out
This usually happens when the workbook is set up as a legacy shared workbook or has a sensitivity label or rights-management protection from your organization. Turn off sharing under Review > Share Workbook (Legacy) if you see it, or ask your IT team about the label. Also make sure the file isn’t open in Protected View; select Enable Editing first.
I forgot the password. Can Microsoft help?
No. Microsoft can’t recover or reset a password on an Excel file. If you have an older, unprotected copy or a backup, use that. Be cautious with “password recovery” tools, which often don’t work on modern encryption and can carry malware.
Related guides

Matt Jacobs writes and maintains the guides on Support Your Tech, which he started in 2017. He spent most of his career keeping small-business PCs running and still takes the occasional consulting job, so the steps here come from fixing the same problems on other people’s computers. Each guide follows Microsoft, Apple and Google’s own documentation and is updated when the steps change. Screenshots marked “Recreated” are illustrations of the real screens.