Password Protect an Excel File to Open on Windows PC

How-to basics · Updated November 20, 2026

To require a password before anyone can open an Excel workbook in Microsoft 365 on Windows, open the file and select File > Info > Protect Workbook > Encrypt with Password. Enter a strong password, confirm it, save the workbook, then close and reopen it to check that Excel asks for the password. This encrypts the file; it is different from protecting a sheet or preventing edits.

Before you start, make sure you are working with the correct workbook and have somewhere safe to store the password. Excel cannot reliably recover a forgotten password for an encrypted file. Keep an unprotected backup only if it can be stored securely, and do not send the password in the same message as the workbook.

What You’ll Need

  • A desktop version of Microsoft Excel for Microsoft 365 on Windows. Excel for the web cannot add a password required to open a workbook.
  • The workbook you want to secure, preferably saved in a current Excel format such as .xlsx or .xlsm.
  • A strong password you can retrieve later, ideally stored in a reputable password manager. The password is case-sensitive.
  • A safe way to share the password separately from the workbook if another person needs access.

Step-by-Step

  1. Open the workbook in the Excel desktop app. Open the file you intend to secure, not a similarly named copy. If it is open in a browser, choose the option to open it in the desktop app. Check the workbook name in the title bar and make sure you can still access the data you need. If the workbook is stored in a shared folder, consider whether collaborators need uninterrupted access before you change its security settings.
  2. Save a working copy first if you are unsure. Use File > Save As to make a copy in a location you control. This is useful when you are learning the process or changing an important shared workbook. Treat any unprotected copy as sensitive: it does not inherit the new password protection, so keep it in a secure location or remove it when it is no longer needed. Do not rely on a backup you cannot safely access.
  3. Open the workbook protection options. Select File in the ribbon to open Backstage view, then select Info. Choose Protect Workbook, and click Encrypt with Password in the menu. The wording matters: Encrypt with Password creates a password requirement for opening the file. Options such as Protect Current Sheet or Protect Workbook Structure control editing or workbook organization; they do not prevent someone from opening and viewing the entire file.
  4. Enter a strong password. In the password box, type a unique password that is difficult to guess. A longer passphrase made from unrelated words can be easier to remember than a short, complicated string. Avoid the workbook name, a company name, birthdays, common phrases, and passwords you use for other accounts. Excel displays dots or other masking characters, so type carefully and check your keyboard layout, Caps Lock, and any special characters.
  5. Confirm the password when prompted. Click OK. Excel asks you to type the same password again to confirm it. Enter it exactly as before, including capitalization, spaces, and punctuation, then click OK. If Excel reports that the entries do not match, dismiss the message and repeat both entries slowly. Do not close the workbook assuming the first entry was enough; the confirmation is part of setting the password.
  6. Save the protected workbook. Press Ctrl+S on Windows, or select File > Save. If Excel asks where to save a new or copied workbook, choose the intended folder and confirm the file name and format. The password setting is not a substitute for saving: until the change is saved, the file on disk might not have the protection you expect. Wait for saving to finish before closing Excel or disconnecting from a network location.
  7. Close the workbook and test it. Close the file, then open it again from its saved location. Excel should display a password prompt before showing the workbook contents. Enter your password and confirm that the correct workbook opens. This practical check catches cases where you edited one copy but later shared another, or where you did not save the change.
  8. Store and share the password carefully. Save the password in your password manager with a clear label that identifies the workbook. When sharing the file, send the password through a different channel, such as a phone call or an approved secure messaging system. Tell recipients that the password is case-sensitive and that they should keep their own secure record. Avoid putting the password in the file name, in a nearby note, or in the same email as the attachment.

On Mac: Excel for Mac has a different route. Open the workbook and choose File > Passwords, then enter a password in the Password to open field and confirm it when prompted. Save, close, and reopen the workbook to verify the prompt. Menu labels can vary slightly between releases. Excel for the web does not provide the desktop command for setting a password required to open; use the Windows or Mac desktop app instead.

Common Mistakes

  • Choosing sheet protection instead of file encryption. Protect Sheet is meant to restrict changes to cells or worksheet features. It does not hide the workbook contents behind an opening password. Use File > Info > Protect Workbook > Encrypt with Password for the opening requirement.
  • Forgetting the password after setting it. Excel does not offer a normal reset link for an encrypted workbook. A password hint, an email to yourself, or a guessable password is not a dependable recovery plan. Store the exact password securely before distributing the file.
  • Changing the wrong copy. A workbook may exist in Downloads, OneDrive, email attachments, and shared folders under the same name. Check the full saved location and test the exact copy you intend to send. Adding protection to one copy does not secure its duplicates.
  • Assuming the workbook is protected before saving. Entering and confirming a password changes the open workbook, but you must save it for the change to be retained in the file. Close and reopen the saved file to verify.
  • Using a weak or reused password. A password such as 1234 or the workbook owner’s name may be easy to guess. Reusing an account password also creates risk if the workbook is shared more widely. Use a unique, sufficiently long password.
  • Confusing opening protection with access permissions. Anyone who knows the password can generally open the workbook and may be able to save or share a copy. A password is not a way to give different people different cell permissions or to prevent every form of copying.

Tips

  • Use a password manager for the exact password. Label the record with the workbook name and, if useful, its storage location. This helps distinguish passwords when several protected workbooks are in circulation. Make sure authorized coworkers know how to obtain the password if they need to work with the file.
  • Agree on a sharing process. Send the workbook through the channel your organization approves, then communicate the password separately. For a team, decide who can distribute the password and how it will be updated if access should change. Changing the password does not recall copies already downloaded or passwords already disclosed.
  • Keep a secure recovery copy when appropriate. If the workbook is business-critical, follow your organization’s backup and records procedures. An unencrypted backup can defeat the protection if it is left in an open folder, so restrict access to it just as carefully as the original. Check that backups can be restored before relying on them.
  • Know what the setting does and does not do. An opening password encrypts the workbook so the contents are not simply visible to someone who lacks the password. It does not replace secure storage, device sign-in, or careful sharing. Once an authorized person opens the workbook, they can work with its contents according to the access they have.
  • Use the desktop app for security changes. Excel for the web can open and edit many workbooks, but it cannot create the password-to-open setting described here. If the option is missing in a browser, open the file in the Windows or Mac desktop app, set the password, save, and test the saved file.

Troubleshooting

There is no Encrypt with Password option. First confirm that you are using the Excel desktop app, rather than Excel for the web or a preview window. On Windows, look under File > Info > Protect Workbook. If you are in the desktop app and the command is still unavailable, check whether the workbook is in a format or state that limits editing, and try saving a copy as an Excel Workbook (.xlsx) or, if it contains macros, an Excel Macro-Enabled Workbook (.xlsm). Preserve the original until you have confirmed the copy retains the workbook features you need. An organization’s Office policies may also restrict security features; ask your administrator if the command is disabled.

Excel does not accept the password I just set. Check that you are opening the same file you changed and that you typed the password with the same capitalization, spacing, and punctuation. Verify the keyboard language and Caps Lock. If you use a password manager, copy the stored entry carefully and make sure it does not include an accidental leading or trailing space. If you can still open the workbook in a session that has not been closed, save a separate accessible copy only if permitted, then carefully reset the password from the correct workbook. Do not assume Excel can retrieve a forgotten password after you have lost access.

The file opens without asking for a password. You may have opened an unprotected duplicate, not saved after encrypting, or used sheet protection rather than Encrypt with Password. Close the file, locate the copy you intended to secure, and check its saved path. In Excel, return to File > Info and review Protect Workbook. Then save the correct file, close it fully, and reopen it from that exact location to test again.

A colleague cannot open the file or says the password fails. Confirm that they received the latest protected copy and the correct password through the separate channel you chose. Ask them to type it rather than relying on a pasted value that may include extra spaces. Check capitalization and special characters. If the password was changed after the file was sent, share the current password securely and send the updated workbook if needed.

The workbook is in a shared cloud folder. Check that the file has finished saving or syncing before you test or distribute it. If another person has an older downloaded copy, changing the password on your copy will not update theirs. Share the newly saved file through the approved location and tell recipients to use that version. For sensitive or regulated information, follow your organization’s rules for encryption and file sharing rather than treating an Excel password as the only safeguard.

Frequently Asked Questions

Does a password to open an Excel file encrypt the workbook?
Yes. The Encrypt with Password command applies encryption so Excel requires the password before displaying the workbook contents. This is different from sheet protection, which limits certain edits after a workbook is open.

Can I password protect an Excel file in a browser?
No. Excel for the web does not provide the desktop command to set a password required to open a workbook. Open the file in Excel for Microsoft 365 on Windows or Excel for Mac, set the opening password there, save it, and test it.

Can Microsoft recover a forgotten Excel opening password?
Do not count on recovery. Microsoft does not provide a general password reset for an encrypted workbook. If the exact password is lost, the file may be inaccessible, so record it securely before closing the workbook.

Is Protect Sheet the same as password protecting a file to open?
No. Protect Sheet can restrict changes to a worksheet, but it does not require a password before the workbook can be opened. Use Encrypt with Password when the goal is to block access to the file contents until a password is entered.

Can I remove or change the password later?
Yes, if you can open the workbook and know its current password. In Windows Excel, open the workbook, go to File > Info > Protect Workbook > Encrypt with Password, clear the password in the dialog to remove it, or enter a replacement password, then save. Test the saved result. On Mac, use File > Passwords and update the Password to open setting.

Will the password stop someone from copying or sharing the workbook?
No. The password controls opening the encrypted file, not what an authorized person does after opening it. Anyone who knows the password may be able to view, copy, or share its contents. Use appropriate access controls and secure sharing practices for sensitive information.

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.