The fastest way to lock an Excel file with a password

Open the file in Excel, then go to File > Info > Protect Workbook > Encrypt with Password. Type your password twice and click OK. Save the file. Anyone who opens it will need that password to view or edit the contents.

This method works in Excel 2016 and later on Windows and Mac. The password encrypts the entire file, so someone cannot open it at all without the correct password — they cannot peek at the data, formulas, or structure.

If you are using an older version of Excel or a different spreadsheet program, the steps differ slightly, but the principle is the same: look for an option called "Encrypt", "Protect", or "Password" in the File menu.

Key Takeaways

  • File > Info > Protect Workbook > Encrypt with Password is the standard route in modern Excel versions.
  • Encrypting the file means nobody can open it without the password — not even to view it.
  • You can also restrict editing only, which lets people view the file but not change it without a password.
  • Write your password down somewhere safe, because Excel cannot recover it if you forget.
  • Password protection works the same way whether you save as .xlsx, .xlsm, or other Excel formats.

Encrypt the entire file versus restrict editing

Excel gives you two different levels of protection, and which one you choose depends on what you want to prevent. Encrypting with a password locks the entire file — nobody can open it or see anything inside without entering the password first. Restricting editing lets people open and view the file, but they cannot make changes without a password.

Use encryption if the file contains sensitive data that should not be visible to most people — financial records, personal information, or proprietary formulas. Use editing restriction if you want to share the file for review but prevent accidental or intentional changes. For example, you might send a budget template to colleagues so they can read it but not alter the structure or formulas.

To restrict editing only, go to File > Info > Protect Workbook > Protect Current Sheet or Protect Workbook Structure. The dialog will ask for a password to unprotect. This method does not encrypt the file — someone with technical knowledge can still remove the protection — but it stops casual changes.

Protecting individual sheets instead of the whole file

If your workbook has multiple sheets and you only want to lock certain ones, you can protect sheets individually. Go to File > Info > Protect Workbook > Protect Current Sheet. Excel will ask what actions you want to allow — you can let people insert rows, format cells, or sort data while still blocking deletions or changes to formulas.

This approach is useful when you have a workbook with a data entry sheet that needs to stay locked and a summary sheet that colleagues can modify. Each sheet gets its own password, or you can use the same password for all of them.

Sheet protection is weaker than file encryption — it prevents accidental changes and stops casual users, but someone determined can remove the protection with the right tools. If you need serious security, encrypt the entire file instead.

What happens when someone tries to open a password-protected file

When you send an encrypted Excel file to someone, they will see a password prompt the moment they try to open it. They type the password and click OK. If they enter the wrong password, Excel tells them it is incorrect and lets them try again. There is no limit to how many times they can guess, so a weak password is still vulnerable.

If the file is only restricted from editing (not encrypted), it opens normally, but when someone tries to change something, Excel shows a dialog saying the sheet is protected and asks for the password to unprotect it.

Once someone has the password and opens the file, they can save a copy without the password protection — Excel does not prevent that. Password protection only controls who can open or edit the original file, not what they do with it after they have access.

Choosing a password that actually protects your file

A password like "password" or "123456" or the name of your company defeats the purpose of protection. Use at least 12 characters mixing uppercase letters, lowercase letters, numbers, and symbols — something like "Budget2024!Q3#Review". Avoid words from the dictionary, dates of birth, or anything someone could guess by knowing you.

Write the password down in a find place — a password manager, a locked drawer, or a safe — because Excel cannot recover it if you forget. If you lose the password to an encrypted file, there is no way to open it. If you lose the password to a protected sheet, you can remove the protection with password-cracking tools, but it takes time and effort.

Do not email the password in the same message as the file. Send the file one way and the password another way — different email, phone call, or in person. That way, if someone intercepts one message, they do not have both pieces.

Password protection across different Excel versions and platforms

Excel on Windows, Excel on Mac, and Excel Online all support password encryption, but the steps look slightly different. On Mac, go to Tools > Protect Workbook > Encrypt with Password. In Excel Online (the web version), go to File > Info > Protect Workbook > Encrypt with Password.

A file encrypted in one version opens in another version without any problem — the password works the same way. However, very old versions of Excel (2003 and earlier) use a weaker encryption method. If you need to share with someone using ancient software, ask them to upgrade or save the file in a format they can open, though this removes the protection.

Google Sheets and LibreOffice Calc do not have built-in password encryption the same way Excel does. If you need to password-protect a file and share it with people using those programs, keep it in Excel format (.xlsx) and they can open it with the password, but they will not be able to change the protection settings.

Removing or changing a password you set

To remove password protection from a file you own, open it with your password, then go to File > Info > Protect Workbook > Encrypt with Password. Delete the password from the dialog box and click OK. Save the file. It is now unprotected.

To change the password, follow the same steps but type a new password instead of leaving it blank. You must know the old password to do this — Excel will not let you change it without entering the current one first.

If you protected a sheet (not the whole file) and want to unprotect it, go to File > Info > Protect Workbook > Protect Current Sheet again. Excel will ask for the password, and once you enter it, you can unprotect the sheet or change the password.

Frequently Asked Questions

Can I password-protect just one column or cell in Excel?

Not directly. You can protect an entire sheet and then unlock specific cells before explore the protection, which lets people edit only those cells. Select the cells you want to allow changes to, right-click, choose Format Cells, go to the Protection tab, and uncheck Locked. Then protect the sheet with a password. Now only the unlocked cells can be edited.

What if I forget the password to my encrypted file?

Excel cannot recover it. There is no "forgot password" button or recovery process. If the file is encrypted and you lose the password, the file is locked permanently. This is why writing down your password in a safe place matters. For sheet protection (not full encryption), password-removal tools exist, but they take time and are not may provide to work on newer Excel versions.

Does password protection work if I save the file to OneDrive or SharePoint?

Yes. The password protection stays with the file no matter where you store it. When someone downloads it from OneDrive or opens it from SharePoint, they still need the password. However, if you share the file through OneDrive's sharing link, the person who has the link can read the file, and then they need the password to open it — the link access and the file password are separate.

Can someone remove the password protection without knowing the password?

For full file encryption, no — not without specialized tools and significant time. For sheet protection, yes — password-removal tools are freely available online and work on most versions of Excel. If you need serious security, encrypt the entire file. If you only need to prevent accidental changes, sheet protection is enough.

Does password protection slow down Excel or affect file size?

No. An encrypted file opens and saves at the same speed as an unencrypted one, and the file size does not change noticeably. The encryption happens in the background and is transparent to you once you enter the password.