Password protecting an Excel file

Do you want to stop people from opening your Excel file, or prevent colleagues from accidentally overwriting formulas? Excel has several kinds of protection for this, and they are often confused. This article explains which protection to use when, how to put a password on an Excel file or worksheet, how to remove the password again and what you can do if you forgot it.

Which protection do you need?

ProtectionWhat does it do?Really secure?
Encrypt with passwordNobody can open the file without the passwordYes, the file is encrypted
Password to modifyAnyone can open it, but only save changes with the passwordNo, it is a speed bump
Protect SheetCells, formulas and formatting cannot be changedNo, it prevents mistakes
Protect Workbook (structure)Sheets cannot be added, deleted, hidden or renamedNo, it prevents mistakes

Microsoft says it plainly: worksheet protection is not a security feature. It stops users from changing things by accident but does not protect confidential data. If nobody may read your data, encrypt the file.

Password protect an Excel file (encrypt)

  1. Open the file in the Excel desktop app.
  2. Go to File > Info.
  3. Click Protect Workbook > Encrypt with Password.
  4. Type a password, click OK and type it again to confirm.
  5. Save the file. From now on Excel asks for the password when opening it.
Note: Excel cannot recover a forgotten password, and neither can Microsoft. Keep the password in a password manager. Passwords are case-sensitive.

Set a password to open and a password to modify

Want everyone to be able to read the file, but only some people to change it?

  1. Choose File > Save As and click Browse.
  2. At the bottom of the dialog, click Tools > General Options.
  3. Enter a Password to open and/or a Password to modify. Optionally tick Read-only recommended.
  4. Click OK and save the file.

Anyone without the password to modify can open the file read-only. They can still save a copy under another name, so do not use this to protect data.

Protect a worksheet

Ideal for a template or form in which colleagues may only fill in certain cells.

  1. Select the cells others may change.
  2. Right-click > Format Cells > Protection tab and untick Locked. By default all cells are locked.
  3. Go to the Review tab and click Protect Sheet.
  4. Optionally type a password and tick what users may still do, such as Select unlocked cells, Sort or Use AutoFilter.
  5. Click OK.
Protect Sheet with a password in Excel

To protect a sheet without opening it, right-click its tab at the bottom and choose Protect Sheet.

Protecting a sheet from the tab's right-click menu in Excel

Tip: with Review > Allow Edit Ranges you give different ranges their own password, so each department can only change its own part.

Protect the workbook structure

Go to Review > Protect Workbook, keep Structure ticked and optionally type a password. After that nobody can add, delete, move, hide or rename sheets. Cell contents can still be changed unless you also protect the sheets.

Remove the password from an Excel file

You always need the current password.

Unprotect Sheet in Excel
Entering the password to remove protection

Excel for the web, Mac and mobile

Forgot the password?

Microsoft cannot retrieve a forgotten Excel password. What you can try:

Be careful with online "password crackers": you would upload a file with possibly confidential data to an unknown party.

Excel files in Teams and SharePoint: use permissions instead

An Excel file in a Teams channel is visible to all members of that team. A password on the file is rarely the best answer there: you have to share the password, it is the same for everyone, and whoever forgets it loses the data. Better options are:

Read also

How to restore deleted files in Microsoft Teams and SharePoint
Security defaults in Microsoft Entra ID: what they do and how to enable them
All Microsoft 365 admin portals in one list: the right URLs in 2026

Nederlandstalige versie: Een Excel-bestand beveiligen met een wachtwoord of het wachtwoord verwijderen


More in English