To lock a document in Excel, you protect the workbook with a password so that others cannot open, edit, or change its structure. The quickest path is File > Info > Protect Workbook > Encrypt with Password, then enter and confirm a password. For finer control, use Review > Protect Sheet to lock cells and Review > Protect Workbook to lock sheet tabs and window layout. You can also mark the file as final to discourage edits. No special tools are needed beyond Excel itself, and the steps below work in Excel for Microsoft 365, Excel 2021, and Excel 2019 on Windows and Mac; menu labels can differ slightly by version and region.
What You'll Need
- Microsoft Excel installed on your computer (desktop version recommended for full protection options).
- The document you want to lock, saved in .xlsx or .xls format.
- A password you will remember—Excel cannot recover it if lost.
- Optional: a backup copy of the file before you start, in case you need to undo changes.
Step-by-Step
- Open the workbook you want to lock in Excel.
- Save a backup copy (File > Save As) so you have an unprotected version if needed.
- Encrypt with a password to open: Go to File > Info > Protect Workbook > Encrypt with Password. Type a password, click OK, then confirm it. This prevents anyone from opening the file without the password. Note that this does not stop edits once the file is open.
- Restrict editing of specific cells: First, unlock the cells you want people to be able to edit. Select those cells, right-click > Format Cells > Protection tab, and clear the Locked checkbox. Then go to Review > Protect Sheet. Enter a password (optional but recommended), choose what users can do (e.g., select locked cells, format cells), and click OK.
- Protect the workbook structure: Go to Review > Protect Workbook. Enter a password if prompted. This prevents users from adding, deleting, renaming, or moving sheets, and from hiding or unhiding sheets.
- Mark as Final (optional): Go to File > Info > Protect Workbook > Mark as Final. This makes the file read-only and displays a message that it is final, but it does not enforce a password—users can still edit by clicking Edit Anyway.
- Save the file (Ctrl+S or Command+S). Your protection settings are now applied.
Common Mistakes
- Forgetting the password: Excel passwords cannot be recovered. Store it in a secure password manager.
- Assuming Encrypt with Password also locks cells: It only restricts opening. Use Protect Sheet for cell-level locking.
- Locking all cells by default: All cells are locked by default when you protect a sheet, so unlock the ones you want editable first.
- Using Mark as Final as security: It is a courtesy flag, not a lock. Anyone can remove it.
- Protecting the workbook without a password: Protection can be turned off easily by anyone. Always set a password.
- Not testing on a copy: Always verify protection works on a duplicate before applying to your only file.
Tips
- Use strong, unique passwords and keep a record in a password manager.
- For shared workbooks, consider using Excel's co-authoring features instead of locking, or protect only specific ranges.
- You can allow specific users to edit ranges by going to Review > Allow Edit Ranges (Windows only).
- If you need to lock the file from opening but still allow editing, use Encrypt with Password and share the password only with trusted people.
- Remember that sheet protection is not encryption; it deters casual changes but is not strong security.
- When sending a locked file, consider also saving as PDF to prevent edits entirely.
Troubleshooting
- Cannot edit cells after protecting sheet: Unlock the cells you need to edit before protecting, or unprotect the sheet (Review > Unprotect Sheet) with the password.
- Forgot password: Excel does not provide a recovery option. You will need to restore from a backup or recreate the file.
- Protect Workbook greyed out: The workbook may be shared or co-authoring is active. Stop sharing (Review > Share Workbook) or close co-authoring sessions.
- Mark as Final not working: It only sets a read-only recommendation; users can click Edit Anyway. Use password protection for real security.
- Cannot add sheets: The workbook structure is protected. Unprotect via Review > Protect Workbook.
- Password prompt not appearing: Ensure you saved the file after setting the password. Close and reopen to test.
Frequently Asked Questions
Can I lock just part of a worksheet?
Yes. Unlock the cells you want editable, then protect the sheet with a password. All other cells become locked.
What is the difference between Protect Sheet and Protect Workbook?
Protect Sheet restricts editing within a worksheet. Protect Workbook restricts structural changes like adding or deleting sheets.
Is Excel password protection secure?
It uses encryption, but older .xls files have weaker protection. For strong security, use .xlsx and a strong password.
Can I remove a password later?
Yes, if you know the password. Open the file, go to File > Info > Protect Workbook > Encrypt with Password, and clear the password field.
Does locking a document prevent copying?
No. Users can still copy content unless you restrict selection or use other measures like PDF conversion.
Can I lock a file on Excel for the web?
Excel for the web has limited protection options. For full features, use the desktop app.