Password Protect an Excel Document From Opening

How-to basics · Updated November 20, 2026

Yes. In Excel for Microsoft 365 on Windows, open the workbook and choose File > Info > Protect Workbook > Encrypt with Password. Enter and confirm a password, then save the file; Excel will require that password the next time someone tries to open it.

What a password to open does

Encrypt with Password protects the contents of the workbook file, rather than merely hiding or locking selected cells. A person who receives the protected file must enter the correct password before Excel displays its contents. This makes it the relevant option when the goal is to stop someone from opening a copy of a workbook, such as a file attached to an email or stored in a shared folder.

This is different from setting a password that allows people to open a workbook but limits changes. Excel also has controls for protecting a worksheet or the structure of a workbook. Those options can be useful for preventing accidental edits, but they do not provide the same barrier to opening the file. Choosing the right protection depends on whether you need confidentiality, edit restrictions, or both.

How to add the password in Excel for Windows

Use the desktop Excel app and save the workbook in a supported Excel workbook format, such as .xlsx or .xlsm. The steps are:

  1. Open the workbook you want to protect.
  2. Select File, then Info.
  3. Select Protect Workbook and choose Encrypt with Password.
  4. Type a password in the dialog box and select OK.
  5. Type the same password again to confirm it, then select OK.
  6. Save the workbook. Close it and reopen it to check that Excel asks for the password.

The password is case-sensitive, so uppercase and lowercase letters matter. Excel does not show a reminder or recovery question in this process. Before closing the file, make sure you have recorded the password securely and that you can reopen the saved copy. If you do not save after setting or changing the password, the change may not be applied to the file on disk.

Choose and store a strong password

A password to open is only useful if it is hard for an unauthorized person to guess and available to the people who should have access. Avoid names, company names, project labels, dates, and short words that might be guessed from the file or its email. A long, unique passphrase is generally easier to remember than a short string of complicated characters. For sensitive workbooks, use a password manager to generate and store a unique password rather than reusing an account password.

Share the password through a separate, suitable channel from the workbook itself. For example, sending both the file and its password in the same email account gives a person who can access that account both pieces. Consider who needs access, how they will receive the password, and how it will be updated if a recipient should no longer have access. A password does not prevent an authorized recipient from copying, photographing, or sharing information after opening the file.

File encryption versus sheet and workbook protection

Excel uses similar protection language for controls with different purposes. Encrypt with Password is the choice for requiring a password before opening the workbook. By contrast, Review > Protect Sheet can restrict actions such as editing locked cells on a worksheet. Review > Protect Workbook can restrict changes to workbook structure, such as adding, deleting, or moving sheets. These latter controls are intended to manage editing; they should not be treated as a substitute for encrypting a file that must remain private.

For example, a budget workbook might contain formulas that colleagues should not accidentally overwrite. Protecting its sheets can help with that editing task. If the workbook also contains confidential salary figures and must not be readable by anyone without permission, set a password to open as well. File encryption does not automatically configure which cells people can edit after they have opened the workbook, so the two kinds of protection can be used together for different reasons.

Check the file and share it carefully

After saving, close the workbook and reopen the exact file you plan to send. Confirm that Excel requests a password and that the password you recorded works. This simple check can catch a common mistake: setting protection in one copy, then attaching an older, unprotected copy with a similar name. Keep a clear distinction between the protected file and any working copy that does not have a password.

File format also matters. Save as an Excel workbook such as .xlsx, or as .xlsm if the workbook contains macros. Saving a workbook as a plain-text or data-only format such as .csv does not preserve the full Excel workbook and its protection settings. Do not assume that changing a file extension adds encryption. If you send the file to someone who uses a different spreadsheet program, confirm that their software supports the password-protected format before relying on it.

Remove or change the password

To remove the password in Excel for Windows, open the workbook with its current password, then choose File > Info > Protect Workbook > Encrypt with Password. Clear the password field so it is empty, select OK, and save the workbook. Close and reopen the saved file to confirm that it no longer asks for a password. Removing the password means anyone who can obtain the file may be able to open it, so consider where existing copies and backups are stored.

To change a password, open the workbook using its current password and return to Encrypt with Password. Replace the value in the password field with the new password, confirm it if prompted, and save. Then test the saved file with the new password. People who were given the previous password may still have older copies; changing the password on your copy does not reach back and alter files already downloaded or emailed.

Excel for Mac and Excel for the web

In current desktop versions of Excel for Mac, open the workbook and look for File > Passwords, then set a password to open the file. The precise wording or location can vary by Excel version, so check the File menu in the installed app if the command differs. After setting the password, save, close, and reopen the workbook to verify it. The Windows ribbon path is not necessarily the path shown in the Mac app.

Excel for the web does not provide the desktop feature for setting this kind of file encryption, and password-encrypted workbooks may need to be opened in the desktop app rather than the browser. If you need to protect a workbook, use Excel for Windows or Mac to apply the password, then verify it in that app. Do not assume a browser-based preview or a cloud sharing link is equivalent to password-encrypting the workbook itself; manage sharing permissions separately.

Common problems and forgotten passwords

  • The password prompt does not appear: Check that you opened the protected copy, not a duplicate or earlier version. Close the file, locate the saved workbook, and test that exact file.
  • The password is rejected: Check capitalization, keyboard layout, and accidental spaces at the beginning or end. If it was copied from a password manager, try entering it directly to rule out a copied extra character.
  • The recipient cannot open it in a browser: Have them use the desktop Excel app and enter the password there. Browser support for encrypted files is limited.
  • You forgot the password: Microsoft does not provide a way to retrieve the password for an encrypted workbook. Check an authorized password manager, secure records, or an earlier backup that you are entitled to use. Do not count on renaming the file or changing its extension to remove encryption.

Because the password is needed to decrypt the file, forgetting it can make the workbook’s contents inaccessible. This is why testing the password and storing it securely are part of setting protection, not optional housekeeping. If the file belongs to an organization, ask its IT or records team whether it has an approved recovery process or an unencrypted source copy. Avoid uploading sensitive workbooks to unknown password-removal services.

Frequently Asked Questions

Can I password protect an Excel file so nobody can open it?
Yes. Use File > Info > Protect Workbook > Encrypt with Password in Excel for Windows, then save. Anyone who has the file will need the password to open its contents.

Is Protect Sheet the same as a password to open?
No. Protect Sheet limits certain changes to a worksheet after it is open. Use Encrypt with Password when you need to require a password before the workbook opens.

Can I recover a forgotten Excel opening password?
There is no Microsoft-provided password recovery for an encrypted workbook. Look for the saved password or an authorized backup, and keep a secure record of passwords for future files.

Can I password protect an Excel workbook in the browser?
Excel for the web does not offer the desktop command for encrypting a workbook with an opening password. Use Excel for Windows or Mac to set it, and use the desktop app to open a password-encrypted file.

Does changing the password update copies I already sent?
No. It changes the workbook you update and save, not separate copies already downloaded, emailed, or stored elsewhere. If appropriate, contact recipients and provide the newly protected file through a secure channel.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.