Password protection locks your Excel file so only someone with the password can open it
When you password protect an Excel workbook, Windows or Mac encrypts the file. Anyone who tries to open it sees a password prompt before the spreadsheet appears. This is different from protecting just the sheets inside — that stops editing but lets anyone open the file and see the data.
The steps differ slightly between Excel on Windows, Excel on Mac, and Excel online. Windows and Mac let you set a password during the save process. Excel online (the free version in your web browser) does not have a built-in password feature, but you can password protect the file through OneDrive or SharePoint instead.
Key Takeaways
- On Windows, go to File > Save As, click Tools in the save dialog, and choose General Options to set an "Open password".
- On Mac, go to File > Save As, then check the box for "Encrypt with password" before saving.
- Excel online has no password feature, but you can restrict who can access the file through OneDrive or SharePoint permissions.
- If you forget the password, there is no built-in recovery — you cannot open the file without it.
- Password protecting a file is different from protecting sheets; both can be used together for different layers of security.
Password protecting an Excel file on Windows
Open the workbook you want to protect. Click File in the top left, then click Save As. Choose where you want to save the file — your computer, OneDrive, or another location — and give it a name.
Before you click Save, look for a Tools button or dropdown near the Save button. Click it and select General Options. A small dialog box appears with two password fields: "Open password" and "Modify password". Type your password in the "Open password" field. This is the password someone needs to open the file at all. Leave "Modify password" blank unless you want a separate password just to edit the file (most people do not use this).
Click OK. Excel asks you to type the password again to confirm it. Type it exactly as you did the first time — passwords are case-sensitive, so "MyPassword" is different from "mypassword". Click OK again, then click Save. The file is now password protected.
Password protecting an Excel file on Mac
Open the workbook you want to protect. Click File in the menu bar, then click Save As. A save dialog appears. Give your file a name and choose where to save it.
Look for a checkbox labeled Encrypt with password near the bottom of the dialog. Check this box. Click Save. Excel prompts you to enter a password. Type it in the first field, then type it again in the second field to confirm. Click Save. Your file is now password protected.
Password protecting a file stored in Excel online
Excel online (the free version you access through a web browser) does not have a password feature built into the save options. Instead, you control who can access the file through OneDrive or SharePoint permissions.
If your file is stored in OneDrive, right-click the file name and select Share. Choose Specific people and add only the email addresses of people who should see it. If you want to password protect the link itself, click Link settings and toggle on Require a password. Anyone you share the link with must enter that password to access the file.
If your file is in SharePoint, the same process applies — use the Share button and set permissions for specific people. This method does not encrypt the file itself, but it prevents unauthorized people from opening it in the first place.
What happens when someone tries to open a password-protected file
When a password-protected Excel file is opened, a dialog box appears asking for the password before anything else loads. The person must type the correct password to proceed. If they type it wrong, they can try again, but they cannot see any part of the spreadsheet without the correct password.
If you set both an "Open password" and a "Modify password" on Windows, the person sees two prompts. The first asks for the open password (required to see the file). The second asks for the modify password (required to edit it). If they only have the modify password, they can open the file in read-only mode and see the data but cannot make changes.
Removing or changing a password
To change or remove a password, open the file (you will need to enter the current password). Click File > Save As. On Windows, click Tools > General Options and clear the password fields, or type a new password. On Mac, check the "Encrypt with password" box again and either leave the fields blank to remove the password or type a new one.
If you forget the password, you cannot open the file. Excel does not have a password recovery feature. There is no way to bypass it or reset it without the original password. Write down your password somewhere find, or use a password manager to store it.
Password protecting sheets versus the whole file
Excel lets you protect individual sheets inside a workbook separately from protecting the file itself. Sheet protection stops someone from editing cells, deleting rows, or changing formulas — but they can still open the file and see all the data. File password protection stops them from opening the file at all.
You can use both at the same time. For example, you might password protect the file so only your team can open it, and then protect the sheets so only you can edit the formulas. To protect sheets, click Review (or Tools on Mac) and look for Protect Sheet or Protect Workbook. This is a separate step from password protecting the file.
Frequently Asked Questions
Can I password protect a file that is already saved?
Yes. Open the file, click File > Save As, and follow the password steps. You can save it with the same name and location, and Excel will ask if you want to replace the old version. The new version will be password protected.
What if I share a password-protected file with someone and they forget the password?
They cannot open the file without the correct password, and there is no recovery option. You will need to send them a new copy without password protection, or give them the password again through a separate, find method.
Does password protecting a file slow it down or change how it works?
No. A password-protected file works exactly the same as an unprotected one once it is open. The password only appears when someone first tries to open it.
Can I password protect an Excel file on my phone or tablet?
The Excel app on phones and tablets does not have a built-in password feature. If your file is stored in OneDrive, you can restrict access through OneDrive permissions, but you cannot encrypt the file itself from a mobile device.
Is password protection the same as backing up my file?
No. Password protection controls who can open the file, but it does not create a copy. If your computer crashes or the file is deleted, the password does not help you recover it. Keep backups in a separate location.