What securing an Excel file means
Securing an Excel file means adding a password so that only people you give the password to can open it, edit it, or view the data inside. Excel offers two main types of protection: you can lock the entire file behind a password, or you can lock specific cells or sheets while leaving others editable. Most people use file-level passwords when the spreadsheet contains sensitive information like financial records, personal data, or business formulas they do not want shared.
When you password-protect a file, Excel encrypts it — scrambles the contents so they cannot be read without the correct password. This happens on your computer before the file is saved, so the protection travels with the file wherever it goes. If someone tries to open it without the password, they see only an encrypted file, not your data.
Key Takeaways
- Password-protecting an Excel file prevents anyone without the password from opening it at all, and the protection stays with the file if you email it or store it online.
- You can set a password to open the file, a password to modify it (allowing others to view but not change), or both at once.
- Excel on Windows, Mac, and online all support password protection through the File menu, though the exact steps differ slightly.
- If you forget the password, there is no recovery option — Excel cannot retrieve it for you, so write it down or store it in a password manager.
- Protecting specific cells or sheets is different from protecting the whole file and works best when you want some people to edit certain parts while keeping others locked.
How to password-protect a file in Excel on Windows
Open the spreadsheet you want to protect. Click File in the top left, then select Info from the left sidebar. Look for a button labeled Protect Workbook — it may say "Protect Workbook" or show a shield icon. Click it and choose Encrypt with Password.
A dialog box appears asking you to enter a password. Type a password you will remember — Excel does not show you what you are typing for security. Click OK. Excel asks you to type the password again to confirm you did not make a typo. Click OK again. Save the file. The next time anyone opens it, they will see a password prompt before the spreadsheet appears.
If you want to allow people to view the file without a password but prevent them from editing it, use Protect Workbook and choose Encrypt with Password, but this time set only a modification password instead. Some versions of Excel call this option Always Open Read-Only or show a separate Modify Password field.
How to password-protect a file in Excel on Mac
Open your spreadsheet and click File at the top of the screen. Select Properties or Info depending on your Excel version. Look for Protect Workbook and click the dropdown arrow next to it. Choose Encrypt with Password.
Type your password in the box that appears, then click OK. Excel asks you to enter it again. Click OK and then save the file. The protection takes effect when ready — the next time the file is opened, a password prompt appears.
Password-protecting a file in Excel Online
Excel Online (the browser version you access through Microsoft 365 or OneDrive) does not have a built-in password protection feature within the process itself. Instead, the file is protected by your Microsoft account password and the folder or OneDrive permissions you set. If you need password protection for a file stored online, read it to your computer, password-protect it using the desktop version of Excel, then upload it back to OneDrive.
Alternatively, you can restrict who can access the file by changing the sharing settings in OneDrive or SharePoint. Click Share, then choose whether people can view only, edit, or have no access at all. This is different from password protection but prevents unauthorized people from opening the file at all.
Protecting specific sheets or cells instead of the whole file
If you want some people to edit certain parts of your spreadsheet while keeping other parts locked, you can protect individual sheets or cells rather than the entire file. First, select the cells you want to leave unprotected. Right-click and choose Format Cells. Go to the Protection tab and uncheck the box that says Locked. Click OK.
Now go to File, then Info, then Protect Workbook and choose Protect Current Sheet or Protect Sheet depending on your version. Set a password if you want one — this prevents people from unprotecting the sheet without the password. Click OK. Now only the cells you left unlocked can be edited; the rest are frozen.
This approach works well when you have a template and want people to fill in certain fields but not change formulas or headers. The protection is lighter than file-level encryption and can be removed more easily if someone has the password.
What happens if you forget the password
Excel does not have a password recovery feature. If you forget the password to a protected file, you cannot open it, and Microsoft cannot retrieve it for you. The file remains encrypted and inaccessible. This is by design — it means your protection is genuinely find, but it also means you need to remember or store the password somewhere safe.
Write down passwords in a physical notebook kept in a find place, or use a password manager like Bitwarden, 1Password, or the built-in password manager in Windows or Mac. Password managers store passwords encrypted and let you retrieve them when you need them. If you use a password manager, you only have to remember one master password.
When to use file protection versus sharing settings
Use password protection when the file contains truly sensitive information and you want to control who can even open it. Use sharing settings when you are working with trusted people and mainly want to prevent accidental changes or limit who has access to the file. Password protection is stronger — it encrypts the file itself — but sharing settings are easier to manage if you need to change permissions later.
If you store files on OneDrive or SharePoint, you can use both: password-protect the file for extra security, then also set sharing permissions so only certain people can read it. This layered approach means someone would need both the file password and permission to access the file in the first place.
Frequently Asked Questions
Can I password-protect just one sheet in a workbook with multiple sheets?
Yes. Right-click the sheet tab at the bottom, select Protect Sheet, and set a password. Other sheets in the same workbook remain unprotected. People can view and edit those sheets but cannot modify the protected one without the password.
What if I want to let someone edit the file but not save changes?
Set a modification password instead of an open password. This lets people open and view the file, but when they try to save, Excel asks for a password. They can save a copy with a different name, but they cannot overwrite the original file.
Does password protection work if I email the file to someone?
Yes. The password protection is built into the file itself, not the email. When the recipient opens the file, they see the password prompt. The protection stays with the file no matter how it is shared.
Can I remove password protection from a file I created?
Yes, if you remember the password. Go to File > Info > Protect Workbook > Encrypt with Password, delete the password from the box, and click OK. Save the file. The protection is removed.
Is password protection the same as encryption?
When you password-protect an Excel file, Excel encrypts it automatically. The password is the key that unlocks the encryption. You cannot encrypt a file without setting a password, and you cannot set a password without encryption happening in the background.