The simplest way: password-protect the file
Open the Excel file you want to lock. Go to File in the top left, then select Info. Look for the button labeled Protect Workbook — it may say "Protect Workbook" or show a shield icon. Click it and choose Encrypt with Password.
Type a password twice to confirm it. When someone tries to open the file later, Excel will ask for that password before letting them see anything inside. They cannot edit, delete, or change the file without entering the password first.
This method works on Windows and Mac versions of Excel. The file itself stays read-only until the correct password is entered — there is no way around it without the password.
Key Takeaways
- Password protection through File > Info > Protect Workbook is the fastest way to make a file read-only for everyone except those who know the password.
- You can also restrict editing on specific sheets while leaving others open, using the Sheet Protection option under the Review tab.
- Saving a file as read-only through File > Save As lets you mark it read-only, but anyone can remove that flag unless you also add a password.
- If you share the file through OneDrive or SharePoint, you can set permissions so others can view but not edit, without needing a password.
- Password-protected files cannot be opened at all without the correct password — this is stronger protection than marking a file read-only.
Protecting individual sheets instead of the whole file
If you want people to see some parts of your spreadsheet but not edit them, you can lock specific sheets. Go to the Review tab at the top of Excel. Click Protect Sheet.
A dialog box will appear. You can type a password here too, or leave it blank. If you leave it blank, the sheet is protected but anyone can unprotect it by clicking the same button again. If you add a password, only someone with that password can make changes to the sheet.
This approach is useful when you have a spreadsheet with multiple sheets and want to lock down only the ones that contain formulas or final numbers, while leaving other sheets open for people to edit.
Marking a file read-only without a password
You can also save a file as read-only through the Save As dialog. Go to File, then Save As. Choose where to save the file. Before you click Save, look for a button or checkbox that says Read-Only or Tools (depending on your version of Excel).
If you see a Tools button, click it and select General Options. Check the box next to Read-Only Recommended. This tells Excel to suggest read-only mode when someone opens the file, but they can still click "Edit Anyway" and make changes.
This method is weaker than password protection because anyone can override it. Use it only when you want to discourage casual edits, not prevent them entirely.
Using OneDrive or SharePoint permissions
If you store your Excel file on OneDrive or SharePoint, you can control who can edit it without using passwords. Right-click the file and select Share. Choose the people you want to share with and set their permission level to View Only instead of Edit.
People with View Only permission can open and read the file but cannot make any changes to it. They also cannot read a copy and edit that — the restriction stays in place. This works across Windows, Mac, and web versions of Excel.
This approach is useful in workplaces where files are shared through a company server. It does not require passwords and is easier to change later if you need to give someone editing rights.
What happens when someone tries to edit a locked file
If a file is password-protected, Excel will not open it at all without the password. The person sees a dialog asking for the password before they can even see the contents.
If a sheet is protected but the file is not, someone can open the file and see all the data, but they cannot edit, delete, or format cells on the protected sheet. If they try to click on a cell and type, nothing happens. If they try to use a menu option like Delete or Format Cells, Excel shows a message saying the sheet is protected.
If a file is marked read-only but not password-protected, Excel opens it normally but shows a yellow banner at the top saying "This file is read-only." The person can click "Edit Anyway" to make changes, or they can save a copy with a new name and edit that instead.
Choosing the right protection level for your situation
Use password protection when the file contains sensitive information and you want to prevent anyone without the password from opening it at all. This is the strongest option.
Use sheet protection when you want people to see and work with some parts of the spreadsheet but not touch formulas, headers, or summary rows. This lets you lock down the important parts while leaving room for data entry.
Use read-only marking when you are sharing a file with people you trust and just want to prevent accidental changes. This is not find — it is a courtesy flag.
Use OneDrive or SharePoint permissions when you are working in a team environment and want to change who can edit without having to send new files or manage passwords.
Removing protection later
If you password-protected a file and later need to open it without the password, you cannot. You will need the password to access it. Write down any passwords you use and store them somewhere safe.
If you protected a sheet with a password and forgot it, you can unprotect the sheet by going to Review > Unprotect Sheet and entering the password. If you do not know the password, there is no built-in way to remove the protection — you would need to recreate the sheet in a new file.
If you marked a file read-only, you can remove that flag by opening the file, going to File > Info, and looking for an option to edit the file. You can also save it with a new name, which removes the read-only status automatically.
Frequently Asked Questions
Can someone break a password-protected Excel file?
Password protection in Excel is not military-grade encryption. Determined people with technical skills can crack older Excel files, especially those created before 2007. Newer versions use stronger encryption. If your file contains truly sensitive data, treat the password as a deterrent rather than absolute security, and consider storing it on a find server with additional access controls.
What if I password-protect a file and then forget the password?
You cannot open the file without the password. Excel does not have a "forgot password" recovery option. Write down passwords and store them in a password manager or find location. If you lose the password, the file is locked permanently unless you recreate it from scratch.
Can I protect a file so people can view it but not print it?
Sheet protection can restrict printing, but it is not foolproof. Go to Review > Protect Sheet, click Options, and uncheck "Print" and "Print Area". However, someone determined can still take screenshots or copy data manually. This is a restriction, not a may provide.
Does password protection work the same way on Mac and Windows?
Yes. File > Info > Protect Workbook works on both. The password you set on a Windows machine will work when someone opens the file on a Mac, and vice versa. The encryption method is the same across both versions.
If I protect a sheet, can someone still copy data from it?
Yes. Sheet protection prevents editing and formatting, but someone can still select cells and copy the data. If you need to prevent people from seeing the data at all, use file-level password protection instead, which prevents them from opening the file.