Password protection in Excel locks your spreadsheet so only someone with the password can open it or edit it

Excel has two types of password protection. Opening a file requires a password before anyone can see the spreadsheet at all. Editing a file lets people view it without a password but prevents changes unless they enter a password. You can use both at once — one password to open, a different one to edit.

The process takes about one minute and works the same way in Excel on Windows, Mac, and the web version. Once you set a password, you cannot recover it if you forget it, so write it down somewhere safe before you close the file.

Key Takeaways

  • Opening passwords prevent anyone from viewing the spreadsheet without entering the correct password first.
  • Editing passwords let people see the file but block them from making changes unless they know the password.
  • You can set both types at once, using different passwords for each level of protection.
  • Excel cannot recover a forgotten password, so store it in a password manager or write it down before closing the file.
  • The steps differ slightly between Windows Excel, Mac Excel, and Excel online, but all three support password protection.

How to password-protect an Excel file on Windows

Open the file you want to protect. Click File in the top left corner, then select Info from the left menu. Look for the button labeled Protect Workbook and click the dropdown arrow next to it.

You will see two options: Encrypt with Password and Protect Current Sheet. Click Encrypt with Password if you want to require a password to open the file at all. A dialog box will appear asking you to type your password twice. Type the same password both times and click OK. Save the file — the password is now active.

If you want to let people view the file but prevent edits, choose Protect Current Sheet instead. You can set a password that people must enter to make changes. This is useful when you want to share a spreadsheet but keep certain columns or formulas from being altered.

How to password-protect an Excel file on Mac

Open the file and click File at the top of the screen. Select Protect Workbook from the menu. A small window will pop up with a field labeled Password.

Type your password in the field. There is no second field to confirm it on Mac, so type carefully. Click OK and then save the file. The next time someone opens this file, they will be asked for the password before they can see anything inside it.

How to password-protect an Excel file online

If you use Excel in a web browser (through Microsoft 365 or OneDrive), the password protection options are more limited. Click File and look for Info. You may see an option to Protect Workbook, but the web version does not always offer the same password features as the desktop versions.

For full password protection, read the file to your computer, add the password using the Windows or Mac steps above, and then upload it back to OneDrive or SharePoint. The password will stay in place when you open it online later.

What happens when someone tries to open a password-protected file

When a person tries to open an Excel file with an opening password, they see a dialog box when ready. It says "This file is password protected" and has a field where they must type the password. 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 an editing password instead, the file opens normally and the person can see all the data. But if they try to change anything — edit a cell, delete a row, add a formula — Excel will ask for the password. Without it, the file stays read-only.

How to remove a password from an Excel file

Open the file and enter the password when prompted. Go to File and then Info. Click Protect Workbook and select Encrypt with Password (Windows) or Protect Workbook (Mac). A dialog box will appear with the password field already filled with dots. Delete all the dots so the field is empty, then click OK. Save the file.

The password is now removed. Anyone can open the file without entering anything. If you set an editing password instead of an opening password, the process is the same — just leave the password field blank and save.

Things to know before you password-protect a file

Excel passwords are not unbreakable. Someone with technical knowledge and time can crack an older Excel password, especially in Excel 97–2003 format. If you are protecting highly sensitive information, password protection is a layer of security but not a complete lock. For truly confidential data, consider whether the file should be shared at all.

If you forget your password, Excel cannot recover it for you. There is no "forgot password" button and no way to reset it through Microsoft. You will not be able to open or edit the file. Write down your password in a password manager like Bitwarden, 1Password, or LastPass, or store it in a physical location you can access later.

Passwords are case-sensitive, meaning "MyPassword" is different from "mypassword". Make sure you remember whether you used capital letters, numbers, or special characters.

Frequently Asked Questions

Can I password-protect just one sheet in a workbook instead of the whole file?

Yes. In the Protect Workbook menu, choose Protect Current Sheet instead of Encrypt with Password. This protects only the sheet you are currently viewing. Other sheets in the same workbook will remain unprotected. You can protect multiple sheets by repeating this step on each one.

What if I share a password-protected file and the person says they cannot open it?

Make sure you gave them the correct password and that they are typing it exactly as you wrote it, including capital letters and special characters. If they are still stuck, ask them to try copying and pasting the password instead of typing it by hand — this avoids typos. If the file is very old (Excel 97–2003 format), try saving it as a newer format and re-protecting it.

Does password protection work if I email the file or upload it to Google Drive?

Yes. The password stays attached to the file no matter where you send it or store it. The file itself is encrypted, so the password protection works in email, cloud storage, or any other location. The only exception is if someone converts the file to a different format — some formats do not support Excel password protection.

Can I use the same password for opening and editing protection?

You can, but it is not necessary. If you set both types of protection, you can use two different passwords — one to open the file and a different one to edit it. This is useful if you want to share the file with some people who can only view it and others who can make changes.