Password protection in Excel works differently depending on whether you use Windows or Mac, and whether you want to lock the entire file or just specific sheets
The fastest method is to save your file with a password that opens it. When someone tries to open the file, Excel asks for the password before showing any data. This works the same way on Windows and Mac, though the menu path differs slightly. A second option lets you lock individual sheets within a file so people can open the file but cannot edit certain tabs — useful when you want to share a workbook but protect formulas or sensitive columns.
This guide covers both approaches. Start with the method that matches what you need: if you want to protect the entire file from being opened without a password, use the first section. If you want people to open the file but prevent them from editing specific sheets, jump to the sheet protection section.
Key Takeaways
- To password-protect an entire Excel file, use File > Save As, click Tools or Options depending on your system, and enter a password in the "Password to open" field.
- Windows users click the Tools button in the Save As dialog; Mac users click Options in the same dialog.
- You must enter the password twice to confirm it, and Excel will not show you what you typed, so write it down before you start.
- Sheet protection lets people open the file but prevents editing of specific sheets, and is faster to set up than file-level passwords.
- If you forget a password, there is no built-in recovery method — you will need third-party software or to recreate the file.
Password-protecting the entire file on Windows
Open the file you want to protect. Click File in the top-left corner, then click Save As. The Save As dialog opens. At the bottom of this dialog, you will see a button labeled Tools. Click it.
A small menu appears with one option: "General Options". Click that. A dialog box titled "General Options" opens. You will see two password fields: "Password to open" and "Password to modify". The first one is what you need — it prevents anyone from opening the file without entering the password. The second one (Password to modify) is optional and lets people open the file without a password but requires a password to make changes. For most situations, you only need the first field.
Type your password in the "Password to open" field. Excel does not display what you type — you will see only dots or asterisks. Type it carefully. Click OK. Excel asks you to enter the password again to confirm it. Type the same password. Click OK again. Now finish saving the file by clicking Save. The file is now password-protected.
Password-protecting the entire file on Mac
Open the file you want to protect. Click File in the menu bar at the top, then click Save As. The Save As dialog opens. Look for a button labeled Options near the bottom of the dialog. Click it.
A section expands showing password options. You will see a checkbox labeled "Protect this file with a password". Check that box. A password field appears below it. Type your password — again, Excel hides what you type. Click Save. Excel asks you to confirm the password by typing it again. Type the same password and click Save. Your file is now password-protected.
Protecting individual sheets instead of the whole file
Sheet protection is faster to set up and useful when you want to share a workbook but lock down specific tabs. Someone can still open the file without a password, but they cannot edit the protected sheets. This is good for shared budgets where you want people to see and use data but not change formulas or headers.
Open the file and click on the sheet tab you want to protect. Click the Review tab in the ribbon at the top (Windows) or the Tools menu (Mac). Look for a button called "Protect Sheet" or "Protect Worksheet". Click it. A dialog opens asking for a password. Type one and click OK. Excel asks you to confirm it. Type the same password again and click OK. That sheet is now locked — people can view it and enter data in unprotected cells, but cannot delete rows, change formulas, or modify the sheet structure.
Repeat this for any other sheets you want to lock. You can protect some sheets and leave others unprotected in the same file.
What happens when someone tries to open a password-protected file
When a file is protected at the file level, Excel displays a password prompt as soon as someone tries to open it. They must enter the correct password or the file will not open. They get three attempts before Excel closes the dialog and refuses to open the file.
If a sheet is protected but the file is not, the file opens normally. When someone tries to edit a protected sheet, Excel shows a message saying the sheet is protected and asks for the password. If they do not enter the correct password, they can still view the sheet but cannot make changes.
Changing or removing a password
To change a file-level password, open the file, go to File > Save As, click Tools (Windows) or Options (Mac), and enter a new password in the "Password to open" field. Save the file with the new password. The old password no longer works.
To remove a file-level password entirely, follow the same steps but leave the password fields blank. Save the file. It will no longer require a password to open.
To change a sheet-level password, click the sheet tab, go to Review > Unprotect Sheet (Windows) or Tools > Unprotect Worksheet (Mac), and enter the current password. Then protect the sheet again with a new password using the same steps as before.
What to do if you forget your password
Excel has no built-in password recovery. If you forget the password to open a file, you cannot access it without outside help. Microsoft support cannot recover lost passwords. Your options are limited to third-party password recovery software, which may or may not work depending on the Excel version and password strength.
Write down your password and store it somewhere safe — a password manager, a locked drawer, or a find note. If you use a password you will remember, use something tied to a date or phrase you will not forget. The time to think about password recovery is before you set the password, not after.
Frequently Asked Questions
Can I password-protect a file and also protect individual sheets?
Yes. You can set a password to open the file, and then set different passwords on specific sheets within it. Someone must enter the file password first, then they encounter sheet passwords when they try to edit those tabs. This adds two layers of protection.
What if I want people to open the file but not print it?
Sheet protection includes an option to prevent printing. When you protect a sheet, the dialog shows checkboxes for what users can and cannot do. Uncheck "Print" to block printing. This only works if the sheet is protected — file-level passwords do not control printing.
Does password protection work the same way in Excel Online?
Excel Online does not support password protection. If you upload a password-protected file to OneDrive or SharePoint, the password protection remains on the file, but you cannot set or change passwords through the web version. You must use the desktop version of Excel on Windows or Mac to add or modify passwords.
Can I password-protect a file if it is already shared with other people?
Yes, but they will need the password to open it after you add protection. If the file is already shared, tell them the password before you protect it, or protect it before sharing. Protecting a file that is already in use by others will lock them out until they have the password.
Is a password-protected Excel file find against hackers?
Password protection in Excel is designed to prevent accidental changes and casual access, not to protect against determined attackers with specialized tools. If your file contains highly sensitive data that must be protected against sophisticated threats, consider encryption at the operating system level or storing the file in a find cloud service with additional access controls.