Protect an Excel File From Opening With a Password

How-to basics · Updated November 20, 2026

To stop people opening an Excel workbook without permission, open it in the Excel desktop app and choose File > Info > Protect Workbook > Encrypt with Password. Enter and confirm a strong password, save the file, then close and reopen it to verify Excel asks for the password. This encrypts the workbook; it is different from merely protecting a worksheet or hiding its contents.

What You’ll Need

  • The workbook saved locally or in a location you can edit. If it contains important data, make a separate backup before changing its security settings.
  • Microsoft Excel for Microsoft 365 on Windows, or a current desktop version of Excel. Excel for the web does not provide the desktop command for adding a password required to open a workbook.
  • A strong password and a safe way to keep it available to authorized people. Excel cannot retrieve a forgotten password for an encrypted workbook.

Step-by-Step

  1. Open the correct workbook in the desktop app. In File Explorer, double-click the workbook or open Excel and select File > Open. Check the filename and, if relevant, the folder location before changing anything. If you are working with a shared file, make sure you have permission to edit it and that you are not looking at an outdated downloaded copy.
  2. Make a backup before applying protection. Use File > Save As to create a separate copy, or copy the file in File Explorer. Give the backup a clear name and keep it somewhere access-controlled. This is useful if you later need an unprotected working copy or discover that an authorized colleague does not have the password. Do not leave an unsecured duplicate in a public or shared folder if the point is to restrict access.
  3. Open the encryption command. In Excel for Microsoft 365 on Windows, select File to open the Backstage view, choose Info, select Protect Workbook, and then choose Encrypt with Password. The command is in the workbook information area, not on the Review tab. A password for opening the file is the option you need; sheet protection and workbook-structure protection do not require a password before the file opens.
  4. Enter a strong password. Type the password in the password box and select OK. Use a long, unique phrase or a password generated and stored in a reputable password manager. Avoid a name, date, short word, or password already used for another account. Excel passwords are case-sensitive, so keep track of capital letters, numbers, and symbols exactly as entered. Do not assume that adding a single number to a familiar password makes it safe.
  5. Confirm the password. Excel asks you to enter it again. Type the same characters and select OK. If the confirmation is rejected, check Caps Lock and re-enter the password carefully. Excel does not show a recovery hint for this encryption password, so verify that your password manager or other secure record contains the correct version before proceeding.
  6. Save the workbook. Select File > Save, or press Ctrl+S on Windows. If Excel prompts you to confirm a file format or save changes, follow the prompt and wait for the save to finish. Keep the workbook in a format that supports modern Excel encryption, such as .xlsx or .xlsm. Avoid converting it to an older format unless you have checked that the format supports the security you need.
  7. Test the protection. Close the workbook completely. Reopen it from its saved location, not from a still-open Excel window. Excel should display a password prompt before showing the workbook. Enter the password and check that the file opens normally. If it opens without asking, return to File > Info > Protect Workbook and confirm that Encrypt with Password was applied to this copy, then save and test again.

On Mac: In Excel for Microsoft 365 for Mac, open the workbook and choose File > Passwords. Enter a password in the Password to open field, confirm it if prompted, and save the file. Menu labels can vary slightly by release, so use the open-password field rather than a password intended only to modify the file. Close and reopen the workbook to test it. Excel for the web can open some password-protected files after a password is supplied, but use the desktop app to set or change this protection.

Common Mistakes

  • Using the wrong kind of protection: Review > Protect Sheet limits changes to cells in an already-open workbook. Protect Workbook can protect the workbook structure. Neither is a substitute for Encrypt with Password when you need Excel to request a password before opening the file.
  • Forgetting the exact password: Passwords are case-sensitive, and a small difference makes the file inaccessible. Store it securely as soon as you set it, and check the saved entry before sending the workbook to anyone.
  • Assuming the setting applies to every copy: A password set on one file does not automatically protect attachments, exports, or older copies. Check the precise file you plan to share and remove unnecessary copies from shared locations.
  • Sending the file and password together: If both arrive in the same email or chat, someone who gains access to the message may get both. Send the password through a separate, trusted channel and only to intended recipients.
  • Confusing encryption with access control: A password helps protect the workbook itself, but it does not stop an authorized recipient from copying, photographing, or sharing its contents after opening it.

Tips

  • Use a password manager to generate and store a unique password. For a workbook shared with a team, decide in advance who is allowed to access the password and how it will be handed over when roles change.
  • Test the file after uploading it to a network folder or cloud storage location. Synchronization can create multiple versions, and users may accidentally open an unprotected copy instead of the protected one.
  • Keep a separately protected backup if the workbook is important. Limit access to the backup too; an unencrypted backup defeats the purpose of securing the main file.
  • Use permissions on OneDrive, SharePoint, or your file server as an additional layer. Restricting who can access or edit a stored file is useful alongside encryption, but it is a separate control and may depend on your organization’s settings.
  • If you need to remove the open password later, open the workbook with its current password, choose File > Info > Protect Workbook > Encrypt with Password, delete the password in the box so it is blank, select OK, and save. On Mac, use File > Passwords, clear the Password to open field, and save. Close and reopen the file to confirm the prompt is gone. Do this only if an unprotected copy is acceptable.

Troubleshooting

The workbook opens without a password prompt. Make sure you selected Encrypt with Password, rather than Protect Sheet or Protect Workbook Structure. Then save, close Excel’s workbook window, and reopen the exact file from its saved location. If you have several similarly named copies, check the full path in File Explorer or the title bar. Confirm the protection on the copy that will actually be shared.

The recipient cannot open the file. Confirm that they are using the password exactly as saved, including capitalization and punctuation. Ask them to type it rather than paste it if the password may include an accidental leading or trailing space. Check that they have the correct attachment or cloud link and a compatible Excel app. Do not send the password in the same message as the workbook; use a separate channel to verify it.

You forgot the password. Try the password manager, secure notes, or the person who created the file. Check for a previous authorized, unencrypted backup if one exists. Microsoft cannot retrieve a forgotten open password, and changing worksheet protection will not unlock an encrypted file. Be cautious of websites or tools that promise guaranteed recovery; do not upload confidential workbooks to an unknown service.

The command is missing or unavailable. Open the workbook in the installed desktop version of Excel rather than a browser tab, and make sure the file is editable rather than opened in a restricted view. If it is read-only, request edit access or save a permitted copy first. In managed workplace environments, an administrator may restrict file operations; ask your IT support team if the command remains unavailable.

The file will not save or another user sees an old version. Check for a read-only status, a sync error, or an open lock from another user. Save to a permitted location, wait for cloud synchronization to finish, and reopen the saved copy to test it. If a format-conversion prompt appears, do not accept an older format without checking its effect on encryption. Keep the original until you confirm the protected version works.

Frequently Asked Questions

Does a password to open an Excel file encrypt its contents?
Yes. Encrypt with Password protects the workbook so Excel requests the password before it opens. This is stronger than hiding a sheet or restricting edits, but it does not prevent an authorized person from copying information after opening it.

Can I password-protect an Excel file in a browser?
Excel for the web does not offer the desktop command to set a password required to open a workbook. Open the file in the Excel desktop app, apply the password, save it, and test the saved file. Browser support for opening protected files can vary by account and file setup.

What is the difference between a password to open and a password to modify?
A password to open is required before Excel displays the workbook. A password to modify is intended to limit editing and may still allow someone to open a read-only copy. Choose the open password when the goal is to prevent access to the workbook’s contents.

Can Microsoft recover a forgotten Excel password?
No. Microsoft does not have a recovery key for a forgotten workbook-encryption password. Keep the password in a secure password manager and maintain an authorized backup so a lost password does not leave you without access.

Will the password still work if I email the workbook?
Usually, if you send the same saved, encrypted file without altering it. Still, test the attachment or shared copy and give the password separately. If you export, convert, or recreate the workbook, check the resulting file because the protection may not carry over as expected.

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.