Set a password when you save the file
The fastest way to password-protect an Excel file is to use the Save As dialog and set a password at that moment. Open the file you want to protect, then go to File > Save As. Choose where you want to save it, type the filename, and look for a Tools button (Windows) or Options button (Mac) near the bottom right of the dialog.
Click that button and select General Options or Security Options. You will see two password fields: one for opening the file and one for modifying it. The opening password means nobody can view the file without entering it. The modifying password means people can view the file but cannot edit it without the password. You can use one, both, or neither — it depends on what you need.
Type your password in whichever field applies, then click OK. Excel will ask you to type the password again to confirm it. After you confirm, click Save and your file is now protected.
Key Takeaways
- Use File > Save As, then click Tools (Windows) or Options (Mac) to find the password fields.
- An opening password prevents anyone from viewing the file without the password; a modifying password lets people view it but not edit it.
- You must type your password twice to confirm it before saving.
- If you forget the password, there is no built-in recovery method — write it down or store it in a password manager.
- Password protection works the same way in Excel Online, but you set it through your OneDrive or SharePoint folder settings instead.
The difference between opening and modifying passwords
An opening password (sometimes called a read password) locks the entire file. Anyone who tries to open it will see a dialog asking for the password before they can see any content. Without the correct password, they cannot view the spreadsheet at all.
A modifying password (sometimes called a write password) lets people open and view the file, but they cannot make changes without entering the password. If someone opens the file without the password, Excel shows it in read-only mode — they can see all the data and formulas, but they cannot edit cells, add rows, or save changes under the original filename.
Use an opening password when the file contains sensitive information that should not be seen by most people. Use a modifying password when you want colleagues to see the data but prevent accidental or unauthorized changes. You can set both passwords on the same file if you need different levels of restriction for different people.
Where to find the password option in different Excel versions
In Excel 2016, 2019, and Microsoft 365 on Windows, go to File > Save As, choose your location, type the filename, and click the Tools button (a small dropdown arrow) in the bottom right corner of the Save As dialog. Select General Options from the menu.
On Mac with Excel 2016 or later, the process is similar: File > Save As, then look for an Options button. Click it and select Security Options. The password fields appear in the same dialog.
In Excel Online (the browser version), you cannot set a password directly in the file. Instead, protect the file through your OneDrive or SharePoint permissions. Right-click the file in your folder, select Share, and adjust who can view or edit it. This controls access without a password prompt.
What happens when someone tries to open a password-protected file
When a user tries to open a file with an opening password, Excel displays a dialog box titled Password with a single text field. They type the password and click OK. If they enter the wrong password, Excel shows an error message and returns them to the password prompt. They can try again as many times as they want — Excel does not lock them out after a certain number of attempts.
If the file has only a modifying password, the file opens normally without any password prompt. However, the title bar shows [Read-Only] next to the filename. If the user tries to edit a cell or make any change, Excel displays a dialog asking for the password. They can click Edit Document and enter the password, or click Cancel to keep viewing in read-only mode.
How to change or remove a password later
To change a password on an existing file, open it (entering the password if required), then go to File > Save As again. Follow the same steps as before: click Tools (Windows) or Options (Mac), select General Options or Security Options, and enter a new password in the same field. Leave the field blank if you want to remove the password entirely.
When you save, Excel will ask you to confirm the new password. The old password no longer works — only the new one will open or modify the file from that point forward.
Important limits of Excel password protection
Excel passwords are not military-grade encryption. They protect against casual access and accidental changes, but someone with technical knowledge and time can potentially break a password on older Excel files. If your file contains highly sensitive data like financial records or personal information, password protection alone may not be enough — consider storing the file in an encrypted folder or using a dedicated password manager to control who has access.
Also remember that if you forget your password, there is no built-in recovery method. Microsoft cannot retrieve it for you. Write down your password in a find location, or store it in a password manager like Bitwarden, 1Password, or LastPass. If you lose the password and need to access the file, you will have to use third-party recovery tools, which may or may not work depending on the Excel version and password strength.
Frequently Asked Questions
Can I password-protect just one sheet in a workbook instead of the whole file?
Yes. Right-click the sheet tab at the bottom of the workbook, select Protect Sheet, and enter a password. This prevents people from editing cells, deleting rows, or changing the sheet structure without the password. However, they can still see the data. To hide the sheet entirely, use Format > Sheet > Hide, though this is not password-protected.
What if I set a password and then forgot it?
There is no official way to recover a forgotten Excel password. You will need to use a third-party password recovery tool, which may or may not work depending on your Excel version and how strong the password is. For future files, store your passwords in a password manager or write them down in a find location.
Does password protection work if I share the file via email or cloud storage?
Yes. The password stays with the file no matter how you send it. When someone receives the file via email or downloads it from OneDrive, they will still need to enter the password to open or edit it. The password is embedded in the file itself, not tied to the sharing method.
Can I set different passwords for different people?
No. Excel uses a single password for opening and a single password for modifying. Everyone who knows the password can use it. If you need different access levels for different people, use OneDrive or SharePoint folder permissions instead, which let you grant view-only or edit access to specific users.