How to Password Lock an Excel File: Protecting Your Spreadsheets

Spreadsheets often contain sensitive data — financial records, personal information, business projections, payroll figures. Excel's built-in password protection gives you meaningful control over who can open, view, or modify those files. But "password locking" isn't a single switch. There are several distinct protection layers in Excel, and understanding what each one does changes how you should approach it.

What "Password Locking" Actually Means in Excel

Excel offers two fundamentally different types of password protection, and confusing them leads to gaps in security:

  • Password to open — Encrypts the file so it cannot be opened at all without the correct password. This is true encryption (AES-128 or AES-256 depending on your Excel version).
  • Password to modify — Allows anyone to open and read the file, but restricts editing. This is not encryption; it's more of an access control flag.

There are also worksheet-level and workbook structure protections, which are separate from file-level passwords entirely.

How to Set a Password to Open an Excel File

This is the strongest protection Excel offers natively. Here's how it works across modern versions:

In Excel for Windows (Microsoft 365, Excel 2019, 2021):

  1. Open the file you want to protect
  2. Go to File → Info → Protect Workbook → Encrypt with Password
  3. Enter your password and confirm it
  4. Save the file

In Excel for Mac:

  1. Go to File → Passwords
  2. Enter a password under "Password to open"
  3. Confirm and save

Once set, the file is encrypted. Anyone without the password — including you — cannot open it. There is no password recovery option built into Excel. If you lose the password, the file is effectively inaccessible.

How to Set a Password to Modify

This option lets the file be opened and read freely but restricts changes:

  1. Go to File → Save As → More Options (or the legacy Save As dialog)
  2. Click Tools → General Options
  3. Enter a password in the "Password to modify" field
  4. Save the file

Users who don't know the password can still open the file in read-only mode. This is useful for distributing reference documents you don't want altered, but it should not be treated as confidential protection — the data is fully visible.

Worksheet and Workbook Protection 🔒

These are often mistaken for file-level security but operate differently:

Protection TypeWhat It DoesRequires Password to Open?
Encrypt with PasswordBlocks file access entirelyYes
Password to ModifyAllows read-only access without passwordNo
Protect SheetLocks cells from editing on a specific sheetNo
Protect Workbook StructurePrevents adding/deleting sheetsNo

Protect Sheet (found under the Review tab) lets you lock specific cells, ranges, or formula inputs. You can allow some users to edit certain ranges while keeping others locked. This is common in shared templates where you want users to fill in specific fields but not touch formulas or structure.

Protect Workbook Structure prevents others from renaming, moving, adding, or deleting worksheets — useful when the tab layout itself is part of a dashboard or reporting structure.

What Encryption Standard Does Excel Actually Use?

Modern Excel versions (2013 and later) use AES-256 encryption when you set a password to open. This is the same standard used in enterprise security tools and is considered robust against brute-force attacks — provided your password is strong.

Older Excel formats (.xls rather than .xlsx) used weaker encryption algorithms and are significantly easier to crack with dedicated software. If you're protecting sensitive data, always save in .xlsx format (or .xlsm for macro-enabled files) rather than the legacy .xls format.

Password Strength Matters More Than You Think

Excel's encryption is only as strong as the password protecting it. A short, simple password can be broken relatively quickly with freely available tools. General best practices:

  • Use at least 12 characters
  • Mix uppercase, lowercase, numbers, and symbols
  • Avoid dictionary words, names, or dates
  • Don't reuse passwords across files or accounts

A password manager can generate and store strong passwords, which matters especially for files you won't open frequently.

Variables That Affect Your Approach 🔑

The right protection method depends on several factors specific to your situation:

  • Who might access the file — a shared network drive versus a personal laptop represent very different threat profiles
  • What you're protecting — hiding formula logic is different from protecting personally identifiable information (PII)
  • How the file is shared — email attachments, cloud storage (OneDrive, SharePoint), or USB drives each carry different risks
  • Your Excel version — older versions may not support the same encryption strength or protection UI
  • Whether collaborators need editing access — shared workbooks with multiple editors require a different protection strategy than read-only distribution

Microsoft 365 subscribers also have access to sensitivity labels and Information Rights Management (IRM) through the Microsoft Purview compliance tools — a more centralized approach that goes well beyond file-level passwords, especially in organizational settings.

One Limitation Worth Knowing

Worksheet-level and workbook structure protections are relatively easy to work around with third-party tools or even some online services. They're useful for preventing accidental edits, not for securing confidential data. Only the "Encrypt with Password" (password to open) option provides genuine security — and even then, the password itself is the critical variable.

The combination of methods you need — file encryption, sheet-level locking, or organizational controls — comes down to your specific file, who has access to it, and what you're actually trying to prevent.