To require a password before anyone can open an Excel workbook in Microsoft 365 for Windows, open the file and choose File > Info > Protect Workbook > Encrypt with Password. Enter and confirm a strong password, then save the workbook. This encrypts the file; it is different from protecting a sheet or locking cells. Before you begin, make sure you can store the password securely, because Microsoft cannot retrieve a forgotten opening password for you.
What You’ll Need
- A Windows computer with the desktop version of Excel for Microsoft 365, and permission to edit the workbook.
- The workbook you want to protect, saved in a format that supports encryption, such as .xlsx or .xlsm.
- A strong password and a safe way to keep it, such as an approved password manager. If other people need access, plan how you will share the password separately from the workbook.
Excel for Mac has a similar password-to-open option, but the menu path differs. Excel for the web does not provide the desktop commands to add or change an opening password, so use the desktop app for this task.
Step-by-Step
-
Open the workbook in desktop Excel. Start Excel and open the file you want to protect. If the workbook is open in a browser, choose the option to open it in the desktop app. Confirm that you have the right file and can make changes before applying encryption.
-
Consider saving a working copy first. Password protection changes how the workbook is stored and who can open it. If the original is important, use File > Save As to create a separate copy before you proceed. Choose a location with appropriate access controls, and give the copy a clear name so you do not accidentally protect the wrong workbook.
-
Open the encryption command. In Excel for Microsoft 365 on Windows, select File > Info. Select Protect Workbook, then choose Encrypt with Password from the menu. This is the command for a password required to open the file. Do not choose options such as Protect Current Sheet or Protect Workbook Structure; those limit editing actions after a workbook is open, but do not keep someone from opening it.
-
Enter a strong password. In the password box, type the password you want to use and select OK. Use a long, unique password that is difficult to guess. A passphrase made from several unrelated words, with additional characters if appropriate, is often easier to remember than a short, complicated string. Passwords are case-sensitive, so Excel treats uppercase and lowercase letters as different characters.
-
Confirm the password exactly. Excel asks you to type the password again. Enter the same characters, including capitalization and punctuation, then select OK. Excel does not show the password as you type it, so take care with keyboard layout, Caps Lock, and accidental spaces. If the two entries do not match, the confirmation will fail and you can try again.
-
Save the workbook. Press Ctrl+S on Windows or select File > Save. The password protection is applied when the workbook is saved. If Excel asks you to choose a file format, keep a format that supports the features you need, usually Excel Workbook (.xlsx) or Excel Macro-Enabled Workbook (.xlsm). Do not change the extension by simply renaming the file; that does not convert its format.
-
Close the file and test the password. Close the workbook, then open it again from its saved location. Excel should prompt for a password before showing the workbook contents. Enter the password and confirm that the file opens correctly. Testing catches cases where you applied protection to a different copy or did not save the change.
-
Share the file and password carefully. Send the protected workbook only to the people who should have access. Provide the password through a separate, suitable channel rather than placing it in the same email or message as the attachment. Tell recipients whether capitalization matters and what to do if they cannot open it. Keep your own secure record of the password.
On a Mac: In current desktop Excel for Mac, open the workbook and use File > Passwords. Enter a password in the Password to open field, confirm it, select OK, and save the workbook. Menu wording can vary slightly by Excel release. Test the saved file by closing and reopening it. On Windows, use the File > Info path above. In Excel for the web, open the file in desktop Excel to set this type of password.
Common Mistakes
-
Choosing sheet protection instead of file encryption. Review > Protect Sheet can restrict editing of cells, and workbook-structure protection can restrict adding or moving sheets. Neither is the same as a password required before opening. Use File > Info > Protect Workbook > Encrypt with Password for that outcome.
-
Forgetting that passwords are case-sensitive. A password entered with a capital letter will not match the same letters entered in lowercase. Spaces at the beginning or end also count. Store the exact password rather than relying on memory or a vague hint.
-
Assuming the password can be reset by Microsoft. The opening password is not a Microsoft account password, and Microsoft support cannot recover a forgotten workbook password. Do not set one until you have a secure recovery plan, and avoid keeping the only copy of a critical file locked behind a password you have not recorded.
-
Protecting one copy but sharing another. A workbook may exist in downloads, email attachments, cloud folders, and shared drives. Check the name and location before setting the password, then verify the exact copy you intend to distribute. Avoid leaving an unprotected duplicate in a shared folder.
-
Confusing encryption with access permissions. Anyone who has the password may be able to open the workbook and make changes, depending on other protections. Encryption does not decide which individual can use the password or prevent an authorized recipient from copying information.
Tips
-
Use a unique password for each sensitive file. Reusing a password means that exposure of one file could put other files at risk. A reputable password manager can generate and store different passwords without requiring you to memorize each one.
-
Keep a protected recovery record. Store the password in an approved password manager or another secure place available to the people who must maintain the workbook. Do not put it in a note on the workbook itself or in a plain text file beside it.
-
Send the password separately. If you attach the workbook to an email, share the password through a different channel, such as an approved secure messaging method. Avoid sending the file and password together in the same email thread, especially when the recipient’s mailbox is shared.
-
Use the right control for your goal. An opening password is appropriate when the workbook contents should not be visible without permission. If you only need to prevent accidental edits, sheet protection or sharing permissions may be more convenient, but those options do not replace encryption for confidentiality.
-
Check organizational requirements. Work or school files may be subject to approved storage, sharing, or encryption rules. Follow your organization’s guidance, particularly if the workbook contains personal, customer, or business-sensitive information.
-
Plan for compatibility. Recipients may need the desktop Excel app to work with an encrypted workbook; browser-based Excel may not support opening or editing it. Let recipients know what app to use and keep an unencrypted copy only where it is appropriate and access-controlled.
Troubleshooting
Excel does not show Encrypt with Password. Confirm that you are using the desktop Excel app on Windows and have opened the workbook, then check File > Info > Protect Workbook. If you are in Excel for the web, open the file in the desktop app. On a Mac, look under File > Passwords. A managed work device or older Excel release may have different menus or restrictions; check with your administrator or update Excel if permitted.
The password prompt does not appear when you reopen the file. Check that you saved after setting the password and that you reopened the same file, not an unprotected original or duplicate. Use File > Info to confirm the workbook indicates that a password is required to open it. Apply the setting again if necessary, save, close, and test the intended copy.
The password is rejected even though you think it is correct. Check Caps Lock, keyboard language, and the characters that may be entered differently on another keyboard. Passwords are case-sensitive and Excel does not display them as you type. If the password is stored in a manager, copy it carefully and ensure that no extra spaces are included. Do not repeatedly guess if there is a risk of losing track of the correct entry.
You forgot the opening password. Microsoft does not provide a way to retrieve or reset this password. Look for the exact password in your password manager, secure recovery record, or with the person who created the workbook. If you have an earlier unencrypted backup, you may be able to use that copy, but it will not contain later changes unless those were saved elsewhere. Avoid untrusted online services that claim to unlock files, especially for sensitive workbooks.
A recipient cannot open the file in a browser. Ask them to download or open the file using the desktop Excel app and enter the password there. If they still cannot open it, verify that the file downloaded completely, that it is a supported Excel format, and that they received the current password. Do not remove encryption just to make browser access easier unless doing so is acceptable for the contents.
You need to change or remove the password. Open the workbook in desktop Excel using its current password. In Windows, choose File > Info > Protect Workbook > Encrypt with Password. Replace the existing password and confirm it to change it. To remove the opening password, clear the password field, select OK, and save. On Mac, use File > Passwords, clear or replace the Password to open field, confirm, and save. Reopen the file to verify the result. Make sure changing the setting is allowed before removing protection from a shared or managed file.
Frequently Asked Questions
Does an opening password encrypt the Excel file?
Yes. Encrypt with Password protects the workbook contents so a person must enter the password to open the file. This is different from sheet protection, which controls certain editing actions after the workbook is open.
Can I password-protect only one worksheet from being viewed?
No. Protect Sheet is intended to restrict changes to a worksheet, not to hide its contents securely from someone who can open the workbook. To prevent access to workbook contents, use an opening password for the file.
Can I open a password-protected workbook in Excel for the web?
Excel for the web does not provide the desktop command to set or change an opening password, and encrypted workbooks may require the desktop app to open. Use Excel for Windows or Mac if the browser cannot open the file.
What happens if I forget the password?
There is no Microsoft password-reset option for an encrypted Excel workbook. Check your secure password record or locate a usable backup. This is why it is important to store the password safely before relying on the protected file.
Will the password protect the file if I email it?
The workbook remains password-protected when you attach or transfer the same encrypted file. However, the password is still needed to open it, so share that password separately and use a trusted method. Encryption does not prevent a recipient who knows the password from copying or forwarding the file.
Can I remove the password later?
Yes, if you know the current password and can open the workbook. Use the same password settings command, clear the opening-password field, confirm, and save. Test the saved copy afterward so you know whether it still requires a password.
Related
- How to Insert an Image in Excel From a Link in Microsoft 365
- How to Insert an Image in an Excel Cell and Make It Fit
- How to Open an Excel File That Is Too Large
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Dropdown From Another Sheet: Setup and FixesYes. In Excel for Microsoft 365 on Windows, create a workbook-level named range for the cells on the…
- Excel to HTML Table: Export, Format, and Embed DataTo convert Excel data to an HTML table in Microsoft 365 for Windows, select the cells if you…
- How to Double Space Between Words in WordTo put two spaces between words in Microsoft Word, open Home > Replace, enter one space in Find…
- Excel Cleanup Guide: How to Clean and Organize DataTo clean an Excel workbook, first save a copy, inspect the data, then standardize text and formats, check…
- Add a White Background and One Border in ExcelTo give cells a white background and a single outline in Excel for Microsoft 365 on Windows, select…
- Excel Table Data Validation: Setup and TroubleshootingTo add data validation to an Excel table, select its data cells, choose Data > Data Validation, and…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.