To stop people opening an Excel workbook without your permission, encrypt it with a password: in Excel for Microsoft 365 on Windows, open the file and choose File > Info > Protect Workbook > Encrypt with Password, then enter and confirm a password and save. The password is required to open the workbook; it is different from protecting a sheet or restricting edits. Make a secure backup and store the password somewhere you can retrieve it before relying on the protection, because Excel cannot recover a forgotten opening password.
What You’ll Need
- The workbook you want to protect, opened in the Excel desktop app. Excel for the web does not provide the command to add an opening password, so open the file in the desktop app first.
- Permission to edit and save the workbook. If it is read-only, locked by another person, or stored in a location where you cannot save changes, you may need to make an editable copy.
- A strong password and a safe way to retain it, such as an approved password manager. Anyone who receives both the file and its password can open it.
- A secure place for a backup copy, particularly if the workbook contains important data. Check your organization’s rules before putting sensitive files or passwords in cloud storage.
Step-by-Step
- Open the workbook in desktop Excel. Start Excel for Microsoft 365 on Windows and open the workbook you want to secure. If you opened it in a browser, use the option to open it in the desktop app. Confirm that you have the correct file and that you can make changes. If the original must remain untouched, use File > Save As to create a separate copy, and protect the copy instead.
- Save a backup before changing its protection. Save a copy in a location with appropriate access controls. This is useful if you enter the wrong password, later forget it, or discover that another person needs access. The backup is only a safeguard if it is stored securely; an unprotected duplicate in a shared folder defeats the purpose. Keep track of which copy is the protected one.
- Open the workbook protection options. Select File to enter the Backstage view, then select Info in the left-hand pane. Choose Protect Workbook, followed by Encrypt with Password. Depending on the Excel window size or build, the commands may appear in a slightly different layout, but the encryption option is under the workbook protection controls on the Info page.
- Enter an opening password. In the password box, type a password that is hard to guess but that you can retrieve later. Passwords are case-sensitive, so Excel treats uppercase and lowercase letters as different. Avoid using a name, a short word, or a password already used for another account. Do not send the password in the same message or channel as the workbook.
- Confirm the password exactly. Excel asks you to type it again. Enter the same characters, including capitalization, numbers, punctuation, and spaces, then confirm. If the two entries differ, the workbook will not be encrypted with the password you intended; cancel or repeat the prompt carefully rather than guessing later.
- Save the workbook. Return to the workbook and save it with Ctrl+S, or use File > Save. If Excel prompts you to confirm a file format, keep a modern Excel format such as .xlsx for a standard workbook or .xlsm if it contains macros. Do not assume a password has been applied until the file has been saved successfully.
- Close the file and test the saved copy. Close the workbook, then open the saved file again. Excel should ask for a password before showing the workbook contents. Enter the password to confirm it works. If the file opens without a prompt, check that you selected Encrypt with Password rather than another protection option, and verify that you reopened the protected copy rather than an unprotected original.
On Excel for Mac, open the workbook and choose File > Passwords. Enter a value in the Password to open field, confirm it when prompted, and save the workbook. The exact dialog wording may vary slightly by Mac version. Excel for the web can open or edit many workbooks, but use desktop Excel to add this file-opening encryption. If the workbook already has an opening password and the web app cannot work with it, open it in the desktop app.
Common Mistakes
- Choosing sheet protection instead of file encryption. Review > Protect Sheet limits changes to a worksheet, while Protect Workbook can restrict changes to workbook structure. Neither is the same as Encrypt with Password. Those other controls do not require a password just to open and view the workbook.
- Forgetting that passwords are case-sensitive. A capital letter, trailing space, or different punctuation can make an otherwise familiar password fail. Use a password manager to copy the saved value carefully, and check that you have not accidentally included a space at the beginning or end.
- Assuming Excel can reset a forgotten password. An opening password encrypts the file. Microsoft support cannot retrieve or reset it for you. A password hint or a second copy of the password stored safely may prevent a permanent loss of access.
- Protecting one copy and sharing another. Save As, email attachments, downloads, and synced folders can create multiple versions. Test the exact file you plan to send, and remove or restrict access to any unprotected copies that contain the same information.
- Confusing a password to open with a password to modify. Some Office password dialogs also offer a password for modifying a file. That may allow someone to open it read-only, so it does not meet the goal of requiring a password before the contents can be opened.
Tips
- Use a long, unique passphrase rather than a short, predictable password. A group of unrelated words with additional characters can be easier to retain and harder to guess than a familiar name or date. Follow your workplace’s password policy if it sets requirements.
- Share the workbook and its password through separate channels. For example, send the file through the approved file-sharing service and provide the password through a different approved method. This reduces the risk that one intercepted message exposes both.
- Limit access to the file itself as well as adding encryption. Store it in a folder or service with appropriate permissions, and share it only with people who need it. File encryption is not a substitute for sensible sharing permissions or secure handling of the password.
- For collaborative work, agree who is responsible for maintaining and distributing the password before sending the workbook. If recipients need regular access, use an approved managed storage or access-control process rather than repeatedly sending password-protected attachments without a plan.
- Keep a record of the password in a trusted password manager or another protected, approved location. Do not save it in a note beside the workbook or in the same unprotected folder. Make sure an authorized colleague can follow your organization’s recovery procedure if you are unavailable.
- After changing or removing the password, save and test the resulting file. A quick open-and-close check confirms that the version in the shared location behaves as intended. If you upload a replacement, tell recipients which version to use and retire old copies when practical.
Troubleshooting
Excel does not ask for a password when I reopen the file. Make sure you used File > Info > Protect Workbook > Encrypt with Password, not Protect Sheet or Protect Workbook Structure. Save the file, close it fully, and reopen the exact saved file from its location. If you have both a local copy and a cloud copy, compare the file name and location before concluding that encryption did not work.
The password is rejected even though I think it is right. Check capitalization, keyboard layout, number-lock state, and punctuation. A password manager can help avoid typing errors. Make sure you are entering the opening password, not a separate password used to modify the file. If it still fails, try a known-good backup or another copy you previously saved. Do not delete the only copy while troubleshooting: Excel generally cannot restore access to an encrypted workbook without the correct password.
I cannot find Encrypt with Password. Confirm that you are using the Excel desktop app on Windows and that the workbook is open. In Excel for the web, open the file in the desktop app to add encryption. On Mac, use File > Passwords and look for Password to open. If the file is read-only, protected by an organization, or in an unsupported state, save an editable copy where permitted and try again. Contact your administrator if a policy blocks the setting.
I added the password, but cannot save the workbook. Check whether the file is read-only, whether another user has it locked, and whether you have permission to write to its folder. Use Save As to save a new copy in a location where you have access, then close and reopen that copy to test it. If the workbook contains macros, preserve the .xlsm format rather than saving it as .xlsx, which does not retain VBA macros.
I need to remove or change the opening password. Open the workbook with its current password. On Windows, go to File > Info > Protect Workbook > Encrypt with Password, clear the password field, select OK, and save. To change it, replace the old value with the new one and confirm it before saving. On Mac, use File > Passwords, clear or change Password to open, and save. Close and reopen the file to verify the result. Anyone with access during the unprotected interval could open it, so work in an appropriate location.
Frequently Asked Questions
Does an opening password encrypt the whole workbook?
Encrypt with Password protects the file so Excel requests the password before opening its contents. It is the right choice when your goal is to prevent unauthorized opening. It is different from protecting individual worksheets or the workbook’s structure, which controls certain edits after a file is open.
Can I password-protect a workbook in Excel for the web?
Use the desktop app to add an opening password. Open the workbook in Excel for Microsoft 365 on Windows or use File > Passwords in Excel for Mac, then save it. The web app does not provide the same command for creating file-opening encryption.
What happens if I forget the password?
You may be unable to open the workbook. Microsoft cannot look up or reset the password for an encrypted file. Check your password manager and secure records, or restore a backup that you can open. Keep the password somewhere protected before you need it.
Can recipients open the workbook without the password?
They cannot open the encrypted workbook normally without its opening password. If they receive the password, they can open it, so share it only with intended recipients and use a separate channel. A recipient may also make another copy after opening, so this does not control what an authorized recipient does with the contents.
Is protecting a worksheet enough to stop someone viewing the file?
No. Worksheet protection is designed to restrict changes, not to prevent opening or viewing the workbook. Use Encrypt with Password for the opening requirement. You can add sheet protection as a separate measure if you also want to limit edits after someone opens the file.
Will the password stay on the workbook after I email or upload it?
The opening password is saved with the encrypted file, so it remains in place when you share that same saved file. Test the attachment or uploaded copy before relying on it, since accidentally sharing an older, unprotected version is a common source of confusion.
Related
- How to Merge Cells in Google Sheets Without Losing Data
- How to Merge Excel Files Using Power Query in Excel
- Merge Cells in Excel Using Keyboard Shortcuts on Windows
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Track Changes in Word: How to Turn It Off and FinishTo get out of Track Changes in Word, open the Review tab and turn off Track Changes. This…
- How to Add Check Boxes in Word for Mac: Clickable or PrintTo add a clickable check box in Word for Mac, enable the Developer tab if needed, then choose…
- Excel Named Range to Table: What Works and What Doesn’tExcel does not have a command that directly converts a named range into a table by name. Select…
- Copy and Paste Word to Excel: Tables, Text, and FormattingTo copy content from Word to Excel, select the text or table in Word, press Ctrl+C, click the…
- A0 Poster in PowerPoint: Set Up and Print at Full SizeTo make an A0 poster in PowerPoint, set the slide to 84.1 cm wide by 118.9 cm high…
- How to Add Clickable Checkboxes in Excel: Step by StepTo add a clickable checkbox in current Microsoft 365 for Windows, select the cell or cells where you…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.