Password Protect Excel to Prevent 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 strong password, then save the file. The password will be required to open the workbook; this is different from protecting a sheet or preventing changes.

What a password to open actually does

Encrypt with Password protects the workbook file itself. Excel requires the password before it displays the contents, so someone who receives or finds the file cannot simply open it in Excel without the correct password. This is the appropriate built-in option when your goal is to prevent opening, rather than merely to discourage editing.

Encryption applies to the saved file, not just to the cells currently visible on the screen. A workbook may contain hidden sheets, formulas, names, or other information that you would not want exposed. If you need to share the workbook, consider what it contains before sending it, even when you have protected it.

A password does not control who can obtain a copy of the file. Anyone with access to the file can keep, copy, or forward it, and a weak or disclosed password can undermine protection. For sensitive information, combine encryption with careful sharing permissions and a secure way to communicate the password.

How to encrypt an Excel workbook on Windows

Use the desktop version of Excel for Microsoft 365 on Windows. The command applies to the workbook you have open, so check that you are editing the correct file before setting the password.

  1. Open the workbook in Excel and choose File > Info.
  2. Select Protect Workbook, then choose Encrypt with Password. If the file is in an older format or has restrictions, save a suitable editable copy first.
  3. Enter the password in the dialog box and select OK.
  4. Enter the same password again to confirm it, then select OK.
  5. Save the workbook. Use Ctrl+S on Windows, or choose File > Save.
  6. Close the workbook and reopen it to check that Excel asks for the password and accepts the one you recorded.

Excel passwords are case-sensitive, so a capital letter is not interchangeable with its lowercase version. Typing a password twice confirms that you entered the same characters both times, but it does not confirm that you will remember them later. Store the password in a reputable password manager before closing the file.

To remove the password later, open the workbook with its current password, return to File > Info > Protect Workbook > Encrypt with Password, delete the dots or characters in the password box so it is empty, select OK, and save. The file will no longer ask for that password when opened. Verify the change by closing and reopening the saved workbook.

Setting a password on Excel for Mac

Excel for Mac has a different menu layout. In current desktop versions, open the workbook and choose File > Passwords. Enter a password in the option for opening the workbook, confirm it, and save the file. Menu wording and availability can vary by Excel version, so distinguish a password to open from any option that only restricts editing.

As on Windows, test the saved file by closing it and opening it again. If you need to remove the password, use the same File > Passwords dialog, clear the opening password, save, and verify. Mac users may use Command+S to save; Ctrl+S is the Windows shortcut.

Excel for the web does not provide the desktop command for adding, changing, or removing file-encryption passwords. A password-encrypted workbook may require the desktop app to open or work with it, depending on the workflow. If a recipient will use a browser, test access with a copy or arrange desktop Excel access before relying on the file.

Choose and store a password carefully

A long, unique password is generally safer than a short password based on a name, date, or familiar phrase. A password manager can generate and retain a random password, which is useful when the workbook is not opened often. Do not reuse a password from email, a work account, or another service.

Plan how legitimate users will get the password. Sending the workbook and its password in the same email or chat means that one compromised account may expose both. A safer arrangement is to share the file through an approved access-controlled location and communicate the password through a separate trusted channel. Follow your organization’s rules for handling confidential data.

Keep an accessible backup of the password, not an unprotected note stored beside the workbook. If several colleagues need access, use an approved shared password manager or another managed process rather than relying on one person’s memory. Avoid placing the password in the workbook name, a visible worksheet, or a message attached to the file.

Opening, changing, and verifying the protected file

After encryption is set, Excel asks for the password when someone opens the workbook. A recipient who has the password can open it and, depending on the file’s other settings, edit or save it. A password to open does not automatically make the workbook read-only after opening, prevent copying, or stop a recipient from sharing the password.

Check the lock behavior before you send the final file. Save, close, and reopen it; confirm Excel prompts for a password and that the password works. Then consider testing with a copy on another device or user account if recipients use different versions of Excel. This can reveal practical issues such as a recipient relying on Excel for the web rather than the desktop app.

Use a separate, securely stored unencrypted backup if you need an emergency recovery copy, and limit who can access it. That backup defeats the protection if it is stored in the same broadly accessible folder as the encrypted file. For especially sensitive workbooks, review the backup location and its access permissions as carefully as the shared copy.

Password to open versus worksheet protection

Excel has several protections with similar names, but they solve different problems. Encrypt with Password is the choice for requiring a password before a workbook can be opened. Review > Protect Sheet is for limiting actions on a particular worksheet after the workbook has already been opened. It can help prevent accidental changes to locked cells, but it is not a substitute for file encryption.

Review > Protect Workbook is commonly used to protect workbook structure, such as restricting changes to the arrangement of sheets. It does not serve the same purpose as encrypting the file to require a password at opening. A workbook can use more than one kind of protection, but selecting sheet or structure protection alone will not conceal its contents from someone who can open the file.

For example, if a team wants people to view a budget but not overwrite formulas, sheet protection may be useful after the file is opened. If the budget should not be readable by anyone who finds the file, use Encrypt with Password. If both confidentiality and some protection against accidental edits matter, use opening encryption and separately configure the relevant sheet protections.

Common problems and recovery limits

If Excel says the password is incorrect, check Caps Lock, keyboard layout, and whether the password contains characters that may be entered differently on another device. Passwords are case-sensitive. If you use a password manager, copy the saved entry carefully and check that it belongs to this workbook rather than a similarly named file.

There is no password hint in the encryption dialog that will reveal the correct password. Microsoft does not provide a way to retrieve a forgotten password for an encrypted workbook. If you cannot find it in a password manager, secure notes, or an authorized backup, you may not be able to access the file. This is why testing the password and preserving it securely are essential before closing the only usable copy.

If Excel does not prompt for a password, you may have protected a sheet or the workbook structure instead of encrypting the file, or you may be opening a different copy. Recheck File > Info > Protect Workbook and confirm the file you saved is the one you are sharing. Also check that the password was not removed in a later save.

Older Excel file formats and third-party spreadsheet apps can behave differently from a current .xlsx file in Microsoft 365. If compatibility matters, test with the actual recipient’s software. Do not convert a protected file and assume its protection survived; reopen the converted copy and verify the password prompt and contents.

Alternatives and sharing considerations

If the main concern is who can access the workbook, storing it in OneDrive or SharePoint and sharing it only with named people can provide access control that a file password alone does not. An administrator may also have organizational sensitivity labels or information-protection tools available. Those controls manage access through an account or policy, while an opening password is tied to the file and can be passed along with it.

If the goal is to distribute information without exposing the original workbook, consider sharing a PDF or a separate copy containing only the required sheets and values. This is not equivalent to encryption: recipients may still copy information from a document they can view, and a PDF can also be forwarded. Remove hidden or confidential content from a copy before sharing, rather than assuming that hiding a sheet removes it from the file.

For a workbook stored in a managed cloud location, combine the organization’s approved sharing permissions with the file’s own protection only when the workflow supports both. Encryption can affect browser previews, automated processing, or coauthoring. Try the exact arrangement with a non-sensitive test file before making it the only way a team can access important data.

Frequently Asked Questions

Can I password protect an Excel file so nobody can open it?

You can require a password to open it by choosing File > Info > Protect Workbook > Encrypt with Password on Windows. This prevents ordinary access without the correct password, but it cannot prevent someone from obtaining or forwarding the file, and a weak or exposed password can be compromised.

Is Protect Sheet enough to stop someone opening my workbook?

No. Protect Sheet limits certain changes after a person opens the workbook. To require a password before its contents can be viewed, use Encrypt with Password. These options address different needs and should not be treated as interchangeable.

Can Microsoft recover a forgotten Excel opening password?

Microsoft does not provide a recovery method for a forgotten password used to encrypt a workbook. Check your password manager and authorized backups. Keep the password safely before closing the only copy you can open.

Can I password protect an Excel workbook in a browser?

Excel for the web does not offer the desktop command to add, change, or remove file-encryption passwords. Use Excel for Windows or Mac to set the password. A recipient may also need desktop Excel to work with an encrypted workbook.

Can someone edit the workbook after entering the password?

Yes, unless you also apply appropriate editing restrictions or share it in a way that limits permissions. A password to open grants access to the workbook; it does not automatically make the opened file read-only or prevent copying.

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.