Password Protect an Excel File Before Opening It Safely

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 before the workbook can be opened; this is different from restricting edits after it opens.

How to set a password to open an Excel file

Set the password in the desktop version of Excel while the workbook is open. The command encrypts the workbook, so a person who receives the saved file must enter the password before Excel reveals its contents.

  1. Open the workbook in Excel for Microsoft 365 on Windows. If it is a new workbook, save it first.
  2. Select File, then Info.
  3. Select Protect Workbook, then Encrypt with Password.
  4. Type a password in the dialog box and select OK.
  5. Enter the same password again when prompted, select OK, and save the workbook.

Excel does not display the password as you type, so enter it carefully. Passwords are case-sensitive: “Northwind27” and “northwind27” are different. After saving, close the workbook and open it again to confirm that Excel prompts for the password. This check can catch a missed save or a password applied to a different copy than the one you plan to share.

On Excel for Mac, the password-to-open setting is generally available under File > Passwords. Enter a value in the field for opening the file, confirm it, and save. Menu wording can vary with the Excel version, so distinguish the password to open from a password to modify. Excel for the web does not provide the same desktop encryption setup; use the desktop app to add or change this password.

What the password protects

A password to open is intended to protect the workbook’s contents while the file is closed. Excel asks for the password before showing worksheets, formulas, or data. That makes it useful for a workbook sent as an email attachment or stored somewhere another person might be able to access.

It does not control every way a file might be exposed. Once someone has opened the workbook, they may be able to copy information, take screenshots, or save an unprotected copy, depending on their access and the protections in place. The password also does not protect the email account, cloud account, or device used to send and store the file. Treat it as one part of a security plan, not as a substitute for access controls and safe handling.

Current Excel versions use file encryption for this feature. That is fundamentally different from putting a password prompt in a worksheet or hiding rows. The encryption applies to the saved file; the password is needed to decrypt its contents for opening. Avoid relying on older formats or outdated Office software for sensitive files, because support and security behavior can differ across versions.

Password to open versus sheet and workbook protection

Excel has several features with similar names, but they solve different problems. The most important distinction is whether a person can open the file at all or can only be prevented from changing particular parts of it.

  • Encrypt with Password: Requires the password before the workbook opens. Choose this when the goal is to keep the contents private from someone who has the file but should not read it.
  • Protect Sheet: Limits actions such as editing locked cells on a worksheet. It does not encrypt the workbook or prevent someone from opening and reading its contents.
  • Protect Workbook structure: Restricts structural changes such as adding, deleting, moving, or renaming sheets. It is not a password-to-open feature.
  • Password to modify: In versions that offer it, this can make a workbook read-only for people who do not have the modification password. It should not be confused with encrypting the file against opening.

A common mistake is to use Review > Protect Sheet and assume the workbook is hidden from anyone without the password. That setting is designed to control editing, not to secure confidential data. If you need a password prompt before any contents are visible, use Encrypt with Password.

Choosing and sharing a strong password

Use a unique password that is difficult to guess. A longer passphrase made from several unrelated words can be easier to type accurately than a short string of complicated characters, while still being hard to guess. Do not use a workbook’s subject, a person’s name, a company name, or a password already used for email or another account.

  • Use a password manager to create and store a unique password.
  • Share the password through a separate, trusted channel rather than putting it in the same email as the workbook.
  • Confirm the recipient can receive the password securely and knows which file it applies to.
  • Keep an authorized copy of the password somewhere accessible to the people responsible for the workbook.

Sending the workbook and its password in the same message weakens the protection: anyone who gets that message may get both. A separate channel helps, though it does not eliminate risks such as a compromised recipient account or a forwarded message. For sensitive business information, follow your organization’s approved storage and sharing rules as well as its password policy.

Compatibility and working with other people

Password-encrypted workbooks are intended to be opened in a compatible desktop version of Excel. A recipient may need to download the file and open it in Excel rather than previewing or editing it in a browser. Excel for the web has limitations with password-encrypted files and does not offer the same workflow for setting the file-open password. If browser-based collaboration is essential, test the process with a non-sensitive sample before relying on it.

For a typical modern workbook, use the Excel Workbook format, .xlsx. If the workbook contains VBA macros, it may need the Excel Macro-Enabled Workbook format, .xlsm; encryption does not remove the macros or make them safe to run. Older .xls files can behave differently in newer and older software. When recipients use older Excel releases or other spreadsheet programs, check compatibility before distributing an important encrypted file.

Encryption also changes the collaboration workflow. People who need to edit the same workbook must know the password and use software that can open the protected file. A password is not a substitute for assigning access to a shared cloud document: cloud permissions govern who can reach the file, while the file password governs opening the encrypted workbook itself. Depending on the service and the way the file is opened, the two controls may affect the user experience differently.

Changing or removing the password

To change a password, open the workbook with its current password, then return to File > Info > Protect Workbook > Encrypt with Password. Replace the existing value, confirm the new one, and save. The exact dialog may show the current password as a blank field rather than displaying it; Excel does not reveal a stored password for you to copy.

To remove the password, open the workbook, use the same Encrypt with Password command, delete the password from the field so it is blank, confirm the change, and save the workbook. Close and reopen the saved copy to check that Excel no longer prompts for a password. Removing encryption means anyone who can access that file can open it, so check that you are changing the intended copy and that an unprotected version will not be exposed unintentionally.

If you change a password, tell authorized collaborators through an appropriate channel and update the password manager or other secure record. Otherwise, someone may retain an old password and be unable to open the latest version. For shared workbooks, agree on who is permitted to change the password and how the new one will be distributed before making the change.

Common problems and misconceptions

If Excel does not ask for a password, first check that you used Encrypt with Password, not Protect Sheet or Protect Workbook structure protection. Then save the file, close it, and reopen the saved copy. If you have multiple files with similar names, verify the folder and filename; the protected copy may not be the one you attached or uploaded.

If a recipient sees an error or cannot open the workbook in a browser, have them download it and try a current desktop version of Excel. Confirm that they are using the exact password, including capitalization and any spaces, and that the file was not changed or damaged during transfer. If it still fails, try a fresh copy from the original saved file rather than repeatedly editing or renaming the only copy.

The most serious problem is a forgotten password. Microsoft does not provide a way to retrieve a forgotten password for an encrypted workbook, and there is no built-in recovery link comparable to resetting an online account password. Keep a secure record and a separate backup before locking an important file. Do not assume that sheet-protection instructions or password-removal steps for an editable worksheet will recover an encrypted file.

Another misconception is that a file password grants permission to use the data. It only controls access to the encrypted file. It does not determine whether the recipient is authorized to use, copy, or redistribute the information. Share the workbook only with appropriate people and use organizational controls where confidentiality or compliance requirements apply.

When another protection method may fit better

If your goal is to stop unauthorized people from accessing a file stored in a shared location, manage access through the storage service as well. For example, restrict the file or folder to named accounts and remove access when it is no longer needed. Those controls can be easier to manage than distributing a shared workbook password, but they depend on the account and service being secured.

If the goal is to let colleagues read a workbook but prevent accidental edits, worksheet protection or read-only sharing may be more convenient. If information should not be distributed in spreadsheet form, consider sharing only the necessary data or using a system designed for controlled access. Choose based on the actual risk: privacy before opening calls for file encryption; edit restrictions call for sheet or workbook protection; controlled collaboration calls for managed sharing permissions.

Frequently Asked Questions

Can I password-protect an Excel file before sending it?

Yes. Apply Encrypt with Password, save the workbook, and reopen it to verify the password prompt. Send the password separately from the file.

Can someone open a password-protected Excel file without the password?

Excel requires the password to decrypt a properly encrypted workbook. Microsoft cannot retrieve a forgotten password, so store it securely and keep a safe backup of important files.

Does Protect Sheet stop people from reading my spreadsheet?

No. Sheet protection limits certain edits but does not encrypt the workbook or hide its contents from someone who can open it. Use Encrypt with Password to require a password at opening.

Can I password-protect an Excel file in Excel for the web?

The desktop Excel app is the appropriate place to set a password that encrypts a workbook before opening. Excel for the web has limitations with password-encrypted files, so use desktop Excel for this task.

What happens if I forget the Excel file password?

You may be unable to open the encrypted workbook. Microsoft does not offer password recovery for it, so keep a secure password record and a separate backup before applying encryption.

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.