To require a password before anyone can open an Excel workbook, open it in the Excel desktop app, choose File > Info > Protect Workbook > Encrypt with Password, enter and confirm a strong password, then save the file. This encrypts the workbook itself; protecting a sheet or workbook structure is a different feature and does not prevent someone from opening the file.
Before you start, make a safe backup and decide how you will store and share the password. Excel cannot restore an encrypted workbook if you forget its opening password, so do not rely on memory alone.
What You’ll Need
- A desktop version of Microsoft Excel. The steps below use Excel for Microsoft 365 on Windows. Excel for the web does not provide the command to encrypt a workbook with an opening password, and it does not support opening password-encrypted workbooks; use the desktop app instead.
- The workbook you want to protect, saved somewhere you can access it again. If it is important, make a separate backup before changing its security settings.
- A strong password and a secure way to keep or share it, such as a reputable password manager or a separate, trusted communication channel.
Step-by-Step
-
Open the correct workbook in desktop Excel. Start Excel and open the file you intend to secure. Check the workbook name in the title bar and make sure you have the intended copy, especially if there are several files with similar names. If the workbook is open in a browser, choose the option to open it in the desktop app, or download a copy and open that copy in Excel.
-
Make a backup before applying the lock. Use File > Save As to create a separate copy in a location you control, or make a protected backup using your normal file-backup process. Keep the backup secure too: an unprotected duplicate defeats the purpose if someone else can access it. Do not overwrite your only copy until you have tested the password-protected version.
-
Open the workbook encryption command. In Excel for Microsoft 365 on Windows, select File to open the Backstage view, select Info, then select Protect Workbook. Choose Encrypt with Password from the menu. Be sure to select the encryption command, not Protect Current Sheet or Protect Workbook Structure. Those other options limit editing actions after a file has been opened; they do not require a password just to open it.
-
Enter a strong password. Type the password in the dialog box and select OK. Use a password that is long, unique, and difficult to guess. A phrase made from several unrelated words can be easier to enter accurately than a short string of complicated characters. Avoid using a password that also protects your email, work account, or another important file. Excel passwords are case-sensitive, so capital letters, spaces, and punctuation must be entered exactly as chosen.
-
Confirm the password. Excel asks you to enter the same password again. Type it carefully and select OK. If Excel reports that the passwords do not match, re-enter both fields; check Caps Lock, the keyboard layout, and whether you included a space at the beginning or end. The confirmation step helps catch a typing mistake, but it does not give you a way to recover the password later.
-
Save the encrypted workbook. Select the Save icon or use File > Save. If Excel asks you to choose a file format, keep a format that supports your workbook’s features, such as .xlsx for a standard workbook or .xlsm for a macro-enabled workbook. The password protects the saved file, so saving is essential. If you used Save As to make a protected copy, confirm the new file name and location before proceeding.
-
Test the saved file before sharing it. Close the workbook, then open the saved copy again. Excel should request a password before displaying its contents. Enter the password to confirm that it works and that the file opens correctly. If you do not see a prompt, check that you saved the correct copy and used Encrypt with Password rather than a sheet or structure protection option. Close the test copy again when finished.
-
Share the password safely. Send the workbook only to people who should have access, and provide the password through a different secure channel when practical. Avoid placing the password in the same email or message as the attachment. Tell recipients that they need desktop Excel or another compatible desktop spreadsheet app to open the encrypted file; do not assume that a web preview will work.
On a Mac: Excel for Mac has a different route. Open the workbook, choose File > Passwords, enter a value in Password to open, confirm it, and save the workbook. Make sure you are setting Password to open, not Password to modify, which is intended to control editing. If your version presents a different dialog, check that Excel is updated and consult its built-in help for the password options available in that version.
Common Mistakes
- Using sheet protection instead of file encryption. Review > Protect Sheet can limit edits to cells, but it does not stop someone from opening the workbook and viewing unprotected content. To require a password at opening, use Encrypt with Password.
- Confusing a password to open with a password to modify. A modify password may let a recipient open a workbook read-only without the password. That is not the same as requiring a password before the contents can be viewed. Check the wording in the dialog before confirming.
- Forgetting the password or saving it only in the workbook. Excel does not keep a recoverable copy for you, and the file itself will not reveal the password. Record it in a secure password manager before relying on the protected file.
- Sending an unprotected copy by mistake. A workbook may have several similarly named copies, or a cloud folder may contain an older version. Reopen the exact attachment or shared file you plan to send and confirm that Excel asks for the password.
- Assuming encryption prevents all copying. Once an authorized person opens the workbook, they may be able to copy, photograph, print, or otherwise use information they can see. Opening protection is not a control over what a recipient does with readable data.
Tips
- Use a unique password for each sensitive workbook. Reusing a password means that exposure of one file could put other files at risk. Store the password with a clear label so you can identify which workbook it belongs to.
- Keep a secure recovery plan. If the workbook matters, retain a backup in a protected location and make sure an authorized colleague or successor can obtain the password if needed. A backup should not be an easily accessible, unencrypted copy stored beside the original.
- Check the recipient’s setup. Password-encrypted workbooks generally need to be opened in a compatible desktop application. If a recipient relies on Excel for the web, send instructions to use desktop Excel or agree on another secure method before you send the file.
- Protect the password as carefully as the file. A strong password offers little protection if it is included in the same message as the workbook or posted where unauthorized people can see it. Use a separate channel and verify the recipient before sending it.
- Review what the workbook contains before sharing. Encryption controls access to the file, but it does not remove hidden sheets, comments, metadata, or information that should not be shared. Remove anything unnecessary before sending the workbook.
- Update the password when access should change. To change it, open the workbook with its current password, go to File > Info > Protect Workbook > Encrypt with Password, replace the existing entry, confirm the new one, and save. Share the new password only with people who still need access.
Troubleshooting
- No password prompt appears: Confirm that you saved after choosing File > Info > Protect Workbook > Encrypt with Password. Close the workbook and reopen the exact saved file from its location. If it opens without a prompt, you may have protected a different copy or selected sheet or structure protection instead.
- The password is rejected: Check capitalization, punctuation, spaces, Caps Lock, and the active keyboard layout. If you copied the password, make sure you did not include an extra space or line break. Verify that you are opening the intended workbook and using its current password, not one for an older copy.
- The file will not open in a browser: Excel for the web cannot open workbooks encrypted with an opening password. Download or open the file in desktop Excel and enter the password there. If you need browser collaboration, consider whether a different access-control approach is appropriate rather than removing encryption without checking who can access the file.
- You forgot the password: Check your password manager, secure records, or the person who created the file. Look for a backup or an earlier version that you are authorized to use. Microsoft support cannot retrieve a forgotten opening password, and there is no built-in reset command that preserves access to the encrypted contents. Avoid experimenting on your only copy; retain it and any backups while you look for the correct password.
- A recipient cannot open the file after entering the password: Ask them to download the complete attachment rather than use a preview, then try desktop Excel. Have them check that the file finished downloading and that they are entering the password for this particular workbook. If problems continue, send a fresh copy through an approved channel and test that copy yourself before sharing it again.
Frequently Asked Questions
Does locking a workbook stop people from opening it?
Yes, if you choose Encrypt with Password and save the workbook. Excel requests the password before revealing the workbook’s contents. Protecting a sheet or workbook structure alone does not do this.
Can I remove the opening password later?
Yes, if you know the current password. Open the file, go to File > Info > Protect Workbook > Encrypt with Password, clear the password field, confirm the blank entry if prompted, and save. The Mac route is File > Passwords; clear the Password to open field and save.
Can Excel recover a forgotten workbook password?
No. Microsoft does not provide a recovery key or reset option for a forgotten file-opening password. Check secure records and backups, and store the password safely when you set it.
Is a password-protected sheet the same as an encrypted workbook?
No. Sheet protection helps limit changes to a worksheet, while workbook-structure protection restricts certain structural edits. Neither is a substitute for Encrypt with Password when the goal is to prevent opening.
Can I open an encrypted workbook in Excel for the web?
No. Use desktop Excel to open a workbook protected with a file-opening password. If you need browser access, plan for a supported sharing method before distributing the file.
Will recipients be unable to copy the data?
No. The password prevents opening the file without authorization, but a recipient who can open it can still copy or otherwise capture visible information. Share only with trusted people and limit the contents to what they need.
Related
- How to Highlight in Microsoft Excel
- How to Highlight in Excel Using Keyboard Shortcuts
- Highlight in Excel Without a Mouse: Keyboard Steps
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 Duplicate an Excel Document on Windows SafelyTo duplicate an Excel document on Windows, open it in Excel and choose File > Save As >…
- Conditional Formatting Across Sheets in Excel: How It WorksYes, Excel can use conditional formatting to compare cells on one worksheet with values on another, but a…
- Excel Columns: How to Format, Resize, and Style ThemTo format a column in Excel for Microsoft 365 on Windows, click its letter at the top of…
- Excel Workbook Sharing: Collaborate Without ConflictsTo share an Excel workbook for live collaboration, save it to OneDrive or SharePoint Online, select the Share…
- Excel: Merge Cell Data Into One CellTo combine values from several Excel cells into one cell without losing the originals, use TEXTJOIN. With first,…
- Excel Date Turns Into Hashtags? Causes and FixesIf an Excel date turns into hashtags such as #####, the cell usually cannot display the formatted value…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.