Yes. In Excel for Microsoft 365 on Windows, open the workbook and select File > Info > Protect Workbook > Encrypt with Password. Enter a password, confirm it, and save the file. The password will be required to open the workbook, not just to edit a worksheet.
How to set an opening password in Excel
Use Excel’s file-encryption option when the goal is to prevent someone without the password from opening the workbook. These steps apply to the desktop version of Excel for Microsoft 365 on Windows:
- Open the workbook you want to protect.
- Select File > Info.
- Select Protect Workbook, then choose Encrypt with Password.
- Type a password and select OK. Enter it again when Excel asks you to confirm.
- Save the workbook. Close it and reopen it to confirm that Excel asks for the password.
Excel does not display the password as you type it, so enter it carefully. The protection is not in effect until you save the file. Keep an unprotected backup only if you can store it somewhere secure; otherwise, that copy defeats the purpose of encrypting the workbook.
In Excel for Mac, use File > Passwords and enter a password in the Password to open field, then confirm and save. The exact dialog appearance can differ by Excel version. Excel for the web does not provide the desktop controls for adding or changing an opening password, so use the Windows or Mac desktop app for this task.
What an opening password actually protects
An opening password encrypts the workbook file. Someone who obtains the file should not be able to read its workbook contents in Excel without the password. This is different from a password that merely blocks editing or hides a sheet. Modern Excel workbook formats such as .xlsx use encryption for this feature; it is not simply a warning screen placed in front of visible data.
Encryption protects the saved file while it is closed. It does not prevent an authorized person who knows the password from opening the workbook, copying its contents, taking screenshots, or sharing an unprotected copy. Nor does it secure a computer that is already compromised or a file that has been opened and left accessible to others. Think of it as a barrier around the stored workbook, not a complete information-security plan.
The password is not the same as your Microsoft account password or a Windows sign-in password. Excel does not use those credentials automatically; you choose a separate password for the workbook.
Choose the right kind of protection
Excel has several protection features with similar names, but they solve different problems. If your requirement is “people must not be able to see the data,” use Encrypt with Password. If the requirement is only “people may view the file but should not change its layout,” a different control may be more appropriate.
- Encrypt with Password: asks for a password before the workbook can be opened. Use this for confidential saved files.
- Protect Sheet: restricts changes to cells or objects on a worksheet. It is useful for preventing accidental edits, but it is not a substitute for file encryption.
- Protect Workbook structure: restricts actions such as adding, deleting, moving, or renaming sheets. It does not stop someone from opening and reading the workbook.
- Read-only or editing restrictions: can discourage changes or control editing in particular situations, but do not mean the workbook’s contents are hidden.
For example, a budget workbook with employee salary information needs an opening password if unauthorized readers must not see the figures. Protecting the sheet so formulas cannot be changed would not meet that requirement: a person could still open and read the salary cells.
Make the password practical and safe
Choose a long, unique password that you can retrieve when needed. A phrase made of several unrelated words can be easier to type accurately than a short string of substitutions, while still being difficult to guess. Avoid names, birthdays, company names, and passwords reused for email or other accounts. Passwords are case-sensitive, and spaces or punctuation may be part of the password, so record the exact characters.
Store the password in an approved password manager or another secure place separate from the workbook. Sending the password in the same email as the attachment provides little separation if that mailbox or message is exposed. If a coworker needs access, share the password through a separate trusted channel and give it only to people who need it.
Consider how the workbook will be used before setting a password. A complex password that nobody can recover can make an important operational file unusable. For a team-owned file, document who is responsible for access and how authorized colleagues can obtain the password. Do not put the password in a visible worksheet, in the workbook’s filename, or in a note stored alongside an unprotected copy.
Change or remove the password
To change the opening password, first open the workbook using its current password. In Windows Excel, go to File > Info > Protect Workbook > Encrypt with Password. Replace the existing entry with the new password, confirm it, and save. On a Mac, use File > Passwords, update the Password to open field, confirm, and save. Test the saved file after closing it.
To remove the password in Windows, open the workbook, return to Encrypt with Password, delete the password so the field is empty, select OK, and save the workbook. On a Mac, clear the Password to open field in File > Passwords and save. After removal, anyone who can access that file can open it without the former password. If you are making an unprotected copy for a specific recipient, check that you are changing the intended copy rather than the protected original.
Share a protected workbook carefully
An opening password and file-sharing permissions are separate safeguards. If a workbook is stored in OneDrive, SharePoint, or another managed location, use its sharing controls to decide who can access the file. A password does not replace those permissions: it can help protect a downloaded copy, but it does not determine who is authorized to use a cloud folder or account.
Before sending a workbook, check the recipient list, the link settings, and whether the recipient needs to edit or only view it. Send the password separately from the file when practical. If a recipient no longer needs access, removing their sharing permission can help prevent future access through that account, but it cannot recall copies they already downloaded or opened. For sensitive information, follow your organization’s rules for approved storage, sharing, and encryption rather than relying on an emailed attachment alone.
Common problems and limitations
If Excel does not ask for a password after you set one, make sure you used Encrypt with Password rather than Protect Sheet or Protect Workbook structure, and confirm that you saved the file. Close it fully and reopen the saved copy. If there are multiple copies with similar names, check that you are opening the protected one.
If Excel rejects a password you believe is correct, check capitalization, keyboard layout, and whether Caps Lock is on. Passwords are case-sensitive. Also confirm that you are opening the correct file and using its current password; an older copy may have a different one. Avoid repeatedly changing the file while troubleshooting, because you could overwrite the only usable copy.
If you forget an opening password, Microsoft does not provide a way to retrieve it or unlock the workbook for you. There is no dependable built-in recovery switch. Some third-party products claim to recover passwords, but their safety, effectiveness, and privacy practices vary; uploading a confidential workbook to an unknown service can create a new risk. Keep a secure record of passwords and test access before relying on a protected file as the only copy of important information.
Older Excel formats and features may behave differently when files are converted or opened in other spreadsheet programs. If compatibility matters, test the protected workbook with the software and recipients that will actually use it. Do not assume that changing a file extension preserves or adds encryption.
When another safeguard may be better
If several people need ongoing access, a shared location with individual accounts and carefully assigned permissions may be easier to manage than passing around one common password. For a workbook that should be viewable but not casually altered, sheet or structure protection can reduce accidental changes, though it does not make the contents secret. For information that should not be distributed in a spreadsheet at all, consider whether the data can be shared in a more controlled system instead.
Use more than one safeguard when the consequences of exposure are serious: protect the file with an opening password, restrict access to its storage location, and limit who receives the password. Each measure addresses a different route to the data. Encryption cannot compensate for a widely shared password, and access permissions cannot protect a separate copy saved outside the managed location.
Frequently Asked Questions
Can I password-protect an Excel file so it cannot be opened?
Yes. Use File > Info > Protect Workbook > Encrypt with Password in Excel for Microsoft 365 on Windows, then save. The opening password is required before the workbook contents can be viewed in Excel.
Is Protect Sheet the same as password-protecting a file?
No. Protect Sheet limits certain edits to a worksheet; it does not prevent someone from opening and reading the workbook. Use Encrypt with Password when you need an opening password.
Can I password-protect a workbook in Excel for the web?
Excel for the web does not offer the desktop command for setting or changing an opening password. Open the file in the Excel desktop app for Windows or Mac and use its password controls.
What happens if I forget the Excel file password?
Excel has no built-in way to retrieve a forgotten opening password, and Microsoft cannot provide it. Keep a secure password record and test that you can open the saved workbook before deleting other copies.
Can someone remove the password after opening the workbook?
Anyone who can open the workbook with its password may be able to save an unprotected copy or remove the password. Share it only with trusted people, and use storage permissions as an additional control.
Related
- Excel Number Format Arrow: What It Does and How to Use It
- Excel Number Format Dropdown: What It Does and How to Use It
- Number Bullets in Excel: Add, Format, and Manage Lists
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Create Labels in Word With an Image and Print ThemTo create labels in Word with an image, choose the matching label-sheet layout, open it as a document,…
- Excel Day Number: Serial Dates, Day of Month and YearIf A2 contains a valid Excel date such as June 15, 2024, and you want its day of…
- Remove Spaces in an Excel Column: Step-by-StepTo remove every ordinary space from a column in Excel, select the column or range, press Ctrl+H, enter…
- Excel Data Validation List: Multiple SelectionsIn Microsoft Excel for Microsoft 365 on Windows, a data validation list allows only one selection per cell…
- Microsoft Word: How to Add a Header and Page NumberIn Microsoft Word for Microsoft 365 on Windows, choose Insert > Header, select a layout, and type your…
- Dropdown List in Excel: How to Create and Manage OneTo generate a dropdown list in Excel for Microsoft 365 on Windows, put the choices in cells, select…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.