The fastest way: use File > Info > Protect Workbook

Open the Excel file you want to protect. Click the File tab in the top left corner, then select Info from the menu on the left. You will see a button labeled Protect Workbook with a dropdown arrow next to it. Click that dropdown and choose Encrypt with Password.

A dialog box will appear asking you to enter a password. Type the password you want to use — Excel does not show the characters as you type, so you will see dots instead. Click OK. Excel will ask you to enter the password a second time to confirm you typed it correctly. Type it again and click OK.

Close and reopen the file to test it. Excel will prompt you for the password before the file opens. If you enter the wrong password, the file will not open. If you forget the password, there is no built-in recovery method — you will need to contact Microsoft support or use a third-party recovery tool, which may or may not work depending on the Excel version and password strength.

Key Takeaways

  • The password protects the entire file from being opened without the correct password.
  • You enter the password through File > Info > Protect Workbook > Encrypt with Password.
  • Excel requires you to type the password twice to prevent typos.
  • Forgetting your password means the file cannot be opened without outside help or recovery tools.
  • This method works in Excel 2016, Excel 2019, Excel for Microsoft 365, and Excel Online with limitations.

What happens when someone tries to open your protected file

When another person (or you, on another device) tries to open the password-protected file, Excel displays a dialog box before the spreadsheet appears. The dialog says "This file is password protected" and has a single text field labeled Password. The person must type the correct password to proceed.

If they type an incorrect password and click OK, Excel shows an error message saying "The password you supplied is not correct. Verify that CAPS LOCK is off and that you have typed the password correctly." The file does not open. They can try again, but each wrong attempt requires them to dismiss the error and re-enter the password.

The difference between file passwords and sheet passwords

A file password (what you just set up) locks the entire Excel workbook. No one can open it or see any of its contents without the password. This is the strongest protection Excel offers.

Sheet passwords are different — they protect individual sheets within a workbook that is already open. Someone could open the file (if it has no file password) but would not be able to edit, delete, or unhide specific sheets you have protected. Sheet passwords are weaker and are meant to prevent accidental changes, not to keep someone out entirely. If you only want to protect certain sheets, use File > Info > Protect Workbook > Protect Current Sheet instead.

Password strength and what makes a password hard to crack

Excel passwords are encrypted when you set them, but the strength of your password matters. A short password like "123" or "password" can be cracked by software in seconds. A strong password has at least 8 characters and mixes uppercase letters, lowercase letters, numbers, and symbols — for example, "Proj2024!Blue".

Excel 2016 and later versions use stronger encryption than older versions. If you are using Excel 2007 or earlier, your password protection is weaker and should not be trusted for sensitive data. If you need to protect truly confidential information, consider using Windows BitLocker or third-party encryption software instead of relying on Excel's built-in password alone.

How to change or remove a password

To change your password, open the file and enter the current password when prompted. Once the file is open, go to File > Info > Protect Workbook > Encrypt with Password again. A dialog will appear with the password field empty. Leave it blank and click OK twice — this removes the password. Then when ready go back to File > Info > Protect Workbook > Encrypt with Password and enter your new password.

To remove the password entirely without setting a new one, follow the same steps but leave the password field empty both times. The file will no longer be password protected.

Password protection in Excel Online and shared files

If you upload a password-protected Excel file to OneDrive or SharePoint, the password still works — anyone trying to read or open the file will need to enter it. However, if you share the file through a shared link, the link itself does not bypass the password. The person who receives the link still has to type the password to open the file.

Excel Online (the browser version) can open password-protected files, but you must enter the password in the browser before the file loads. You cannot set a new password using Excel Online — you must use the desktop version of Excel to add or change a password. If you are collaborating with others and want to password-protect a shared file, set the password in the desktop version first, then upload it to OneDrive or SharePoint.

Common mistakes that leave files unprotected

The most common mistake is saving the file without closing it after setting the password. The password does not take effect until you close and reopen the file. If you set a password and then when ready send the file to someone else without closing it, they may be able to open it without entering a password on their computer.

Another mistake is using the same password for multiple files or accounts. If one password is compromised, all your files become vulnerable. Use a different password for each important file, or use a password manager to keep track of them.

A third mistake is forgetting to password-protect the file in the first place. If you think you set a password but never tested it by closing and reopening the file, you may have skipped the confirmation step. Always close the file and try opening it again to verify the password works.

Frequently Asked Questions

Can I password protect just one sheet instead of the whole file?

Yes. Go to File > Info > Protect Workbook > Protect Current Sheet. This prevents others from editing, deleting, or unhiding that specific sheet, but they can still open the file and see other unprotected sheets. This is weaker protection than a file password and is meant to prevent accidental changes.

What if I forget the password?

Excel has no built-in password recovery. You cannot open the file without the correct password. Some third-party tools claim to recover or reset Excel passwords, but they do not work on newer Excel versions with strong encryption. Your only option is to contact Microsoft support or accept that the file cannot be opened.

Does password protecting an Excel file slow it down?

No. The password only affects the moment you open the file. Once it is open, the file runs at normal speed. The encryption adds a tiny amount of time when you first open or save the file, but it is not noticeable.

Can I password protect a file that is already shared with others?

Yes, but they will need the password to open it after you add protection. If you add a password to a file that others are already using, tell them the password before you upload the protected version. If the file is open in their Excel when you password-protect it, they will not be locked out until they close and reopen it.

Does the password protect the file if someone copies it to a USB drive?

Yes. The password is tied to the file itself, not to where it is stored. If someone copies your password-protected file to a USB drive, email, or cloud storage, they still need the password to open it on any device.