How to Password Protect an Excel File from Opening

How-to basics · Updated November 20, 2026

To stop someone opening an Excel file without your permission, open it in Excel for Microsoft 365 on Windows and choose File > Info > Protect Workbook > Encrypt with Password. Enter and confirm a password, then save the workbook. This adds a password requirement to open the file, rather than merely protecting cells after someone has opened it. Keep the password somewhere safe: if you lose it, Microsoft generally cannot recover the workbook for you.

What You’ll Need

  • Excel for Microsoft 365 desktop on Windows. The instructions below use this version. The Excel desktop app is required to set a password that encrypts a workbook for opening; Excel for the web does not provide the same password-setting command.
  • The workbook you want to protect. If you have not created it yet, save it as an Excel workbook, typically an .xlsx file, before applying protection. A macro-enabled workbook can use the same open-password feature while retaining its .xlsm format.
  • A password you can retrieve later. Use a password manager or another secure, accessible place. A long, unique password is safer than a short or reused one, but it must still be available to the people who need to open the file.
  • A safe backup or copy. Make a separate copy before applying encryption, especially if the workbook is business-critical or shared. Check that the copy is stored securely too; an unprotected duplicate defeats the purpose.

Step-by-Step

  1. Open the correct workbook in the desktop app. Start Excel and open the file you intend to protect. Check the workbook name in the title bar and confirm that you are editing the latest version. If it is open in a browser, choose the option to open it in the desktop app, or download a copy and open that in Excel. Avoid applying a password to a temporary or outdated copy by mistake.
  2. Save a backup before changing protection. Choose File > Save As or File > Save a Copy, depending on the commands shown in your version, and save a separate copy in a secure location. Give the copy a clear name so you can identify it. This is a precaution in case you enter the wrong password, protect the wrong file, or need to compare the result with the original.
  3. Open the workbook protection options. Select File to open the Backstage view, then select Info. Choose Protect Workbook, which opens a menu of protection choices. Select Encrypt with Password. Do not choose options that protect a worksheet or workbook structure if your goal is to block opening the whole file; those options address different kinds of access.
  4. Enter your chosen password. In the password box, type the password you want to require when the file is opened, then select OK. Excel may display the characters as dots or bullets, so type carefully. Passwords are case-sensitive: uppercase and lowercase letters, numbers, punctuation, and spaces must match when you enter it again. If you use a password manager, generate or retrieve the password before continuing.
  5. Confirm the password. When Excel prompts you to re-enter it, type the same characters and select OK. This confirmation catches some typing mistakes, but it does not tell you what the password is if you later forget it. Store the exact password securely before closing the workbook, and make sure you can access that record.
  6. Save the protected workbook. Press Ctrl+S on Windows, or choose File > Save. If Excel asks whether to save changes, confirm. The encryption is applied to the saved file; entering a password without saving does not reliably protect the copy that will be shared. Wait for any save or upload indicator to finish if the workbook is stored in OneDrive or SharePoint.
  7. Test the password requirement. Close the workbook, then reopen the saved file from its actual location. Excel should ask for a password before showing the workbook contents. Enter the password you recorded and verify that the file opens and that its worksheets and data look right. If it opens without a prompt, check that you tested the protected copy rather than an unprotected duplicate, and repeat the process on the file you intend to distribute.
  8. Share the file and password safely. Send or store the encrypted workbook separately from the password when practical. For example, share the file through an approved secure location and convey the password through a different trusted channel. Anyone who obtains both can open the workbook, and a password does not prevent a recipient from copying, photographing, or redistributing information after opening it.

On Excel for Mac, the labels differ by release. In many current versions, open the workbook and choose File > Passwords, then enter a password in the field for opening the workbook, confirm it, and save. If that command is not present, check the File menu and Excel’s help for your installed version. Excel for the web does not offer the desktop command to encrypt a workbook with a password; use Excel desktop to set or change this protection. A password-encrypted file may also need to be opened in the desktop app rather than in a browser.

Common Mistakes

Choosing sheet protection instead of an open password. Worksheet protection can restrict edits to locked cells, but it does not stop someone from opening the workbook and viewing its contents. Likewise, protecting workbook structure restricts actions such as adding or moving sheets, not opening the file. For a password prompt before access, use Encrypt with Password.

Assuming the password is saved when it is not. The password requirement must be saved with the workbook. If you set a password and close the file without saving, the saved version may remain unprotected. Save, close, and reopen the exact copy to confirm the change took effect.

Forgetting that passwords are case-sensitive. A capital letter, punctuation mark, or extra space can cause the confirmation or later sign-in to fail. Avoid typing a password from memory if you can paste it from a secure password manager. When pasting, check for an accidental leading or trailing space.

Using a password that is easy to guess or reused elsewhere. A name, company, date, or common phrase may be guessed, particularly if someone knows you or the workbook’s context. Use a unique, longer password. Do not use the same password as your email or other important accounts.

Confusing encryption with complete data security. An open password protects the saved file from being opened without the password, but it cannot control what an authorized person does after opening it. It also does not secure an unprotected copy, a screenshot, or an exported file. Review where duplicates and backups are stored before sharing.

Removing the password from the wrong copy. If you keep several versions, it is easy to change or distribute the wrong one. Give protected and unprotected copies unmistakable names, and verify the storage location before sending anything. Consider deleting obsolete unprotected copies from shared folders when you have confirmed they are no longer needed.

Tips

Use a password manager to create and save a unique password for the workbook. A memorable but long passphrase can also work if it is not a familiar quotation or personal detail. Make sure the people who are authorized to open the file can retrieve the password, including a designated colleague if the workbook must remain accessible when you are unavailable.

Keep a protected backup in a separate, access-controlled location. A backup helps if the working file is damaged or overwritten, but it should have the same protection if it contains the same sensitive data. Check that your cloud storage, email attachment, USB drive, or team folder is an appropriate place for the workbook and its backup.

If you are sharing a workbook for collaboration, agree on how password changes will be communicated. Changing the password can prevent collaborators using the old one from opening the updated file. Avoid putting the password in the same email message or chat as the attachment when a separate secure channel is available.

For files containing highly sensitive information, consider whether all recipients need the full workbook. Remove unnecessary data before sharing and follow your organization’s approved storage and access rules. File encryption is one useful barrier, not a substitute for limiting access to the file itself.

To remove an open password later in Excel for Windows, open the workbook using its current password, then go to File > Info > Protect Workbook > Encrypt with Password. Delete the password from the box, leave it blank, select OK, and save the workbook. Close and reopen the saved file to confirm Excel no longer asks for the password. Store any unprotected version with the same care as the original data.

Troubleshooting

Excel does not show Encrypt with Password. Confirm that you opened the workbook in the desktop version of Excel, not Excel for the web or a preview pane. In Windows, check File > Info > Protect Workbook. If you are on a Mac, look for the password controls under File > Passwords; exact menu labels can vary by release. If the workbook is open in another spreadsheet program, use Excel desktop to apply this Excel-specific protection.

The workbook opens without asking for a password. First check whether you reopened the same file you protected. Files with similar names may be in different folders, and a cloud service may leave an older copy available. In the open workbook, inspect File > Info > Protect Workbook to see whether encryption is indicated, save again, close Excel, and test the file from the folder or shared location where recipients will access it.

The password is rejected. Check Caps Lock, keyboard layout, punctuation, and whether the password manager inserted a space. Make sure you are entering the password for opening the file, not a password for a different workbook or for editing. Try the exact saved entry on the original protected file. If the correct password is unavailable, Microsoft does not provide a standard way to retrieve an encrypted workbook’s forgotten open password; check secure records or contact the person who created it.

The file will not open in Excel for the web. Open the encrypted workbook in the Excel desktop app and enter the password there. If the file is in OneDrive or SharePoint, use the available option to open it in the desktop app. Do not remove encryption just to make browser access easier unless the information can safely be stored and shared without that protection.

Recipients cannot open the file after you change the password. Ensure they have the current password and the latest saved file. An older downloaded copy may still require the old password, while the updated copy requires the new one. Send a fresh copy through the approved sharing method and communicate the current password separately.

Frequently Asked Questions

Is password-protecting a workbook the same as protecting a worksheet?
No. Encrypt with Password requires a password before the workbook can be opened. Worksheet protection mainly limits edits to parts of a workbook that is already open; it is not a substitute for an open password.

Can I recover a forgotten Excel open password?
Usually, there is no Microsoft recovery option for a forgotten password used to encrypt a workbook. Check your password manager, secure notes, or the person who created the file. This is why saving the password before closing Excel is important.

Can I set an open password in Excel for the web?
No. Use Excel for Microsoft 365 desktop on Windows, or the password controls in Excel for Mac, to set the file-open password. A password-encrypted workbook may need the desktop app to open.

Does a password stop people from copying the workbook?
It prevents opening the encrypted file without the password, but it does not stop an authorized person from copying or sharing the contents after opening it. Protect access to the file and share it only with people who should see its data.

Can I password-protect only one worksheet?
You can protect an individual worksheet against certain changes, but that does not hide the workbook’s contents from someone who can open it. If the goal is to prevent opening, encrypt the whole workbook with an open password.

Will the password stay in place when I email the workbook?
Yes, if you send the saved, encrypted workbook itself. The recipient will need the current password to open it. Confirm that you attached the protected copy, not an unprotected duplicate, and share the password through a safe 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.