How to Unprotect an Excel Workbook Without the Password
You can open the file, but Excel says "Cannot rename a sheet in a protected workbook" or "The workbook is protected and cannot be changed." The sheet tabs are greyed out, hidden sheets are inaccessible, and you do not have the password. Good news — workbook structure protection is not encryption. It is a simple XML gate that can be removed in minutes without the original password.
Workbook protection vs sheet protection — know the difference
Workbook structure protection (Review → Protect Workbook) locks operations on sheets: rename, delete, hide, unhide, insert, move. It also prevents viewing very hidden sheets. Sheet protection (Review → Protect Sheet) locks editing within a specific sheet. They are stored in different locations inside the .xlsx file and removed independently. This article covers workbook structure protection. If you need sheet protection removal instead, see our sheet protection guide.
Method 1 — Remove workbookProtection via XML edit (best method)
An .xlsx file is a ZIP archive containing XML files. Workbook protection is stored as a single element inside xl/workbook.xml. Deleting it removes the protection completely.
- Make a backup copy of your workbook. Never modify the original directly.
- Rename the copy from
workbook.xlsxtoworkbook.zip. If file extensions are hidden, enable them in File Explorer's View tab. - Open the ZIP with 7-Zip, WinRAR, or the built-in Windows ZIP handler.
- Navigate to
xl/workbook.xml. Right-click and choose Edit (or extract, edit in Notepad++, VS Code, etc.). - Find the
<workbookProtectionelement. It looks like this:
<workbookProtection workbookPassword="..."" lockStructure="1" lockWindows="1"/>- Delete the entire line containing
<workbookProtectionfrom the root<workbook>element. Make sure no trailing whitespace or empty tags are left behind. - Save the file — if editing inside the ZIP, the archiver prompts to update the archive. Accept.
- Rename back from
.zipto.xlsx. - Open in Excel — protection is gone. You can now rename, delete, hide, and unhide sheets freely. If Excel warns about content, choose Yes — it will preserve all data.
This method works on .xlsx, .xlsm (macro-enabled), .xltx (template), and .xltm (macro-enabled template) files from any modern Excel version including 365, 2021, 2019, and 2016.
Method 2 — VBA macro to unprotect workbook
If you prefer not to edit XML manually, a short VBA macro can remove workbook protection. This works on both .xlsx and .xlsm files, and is especially useful for batch processing multiple workbooks.
- Open the protected workbook in Excel.
- Press Alt + F11 to open the VBA editor.
- Insert → Module and paste the following code:
Sub UnprotectWorkbook()
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
On Error Resume Next
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For n = 32 To 126
ActiveWorkbook.Unprotect Chr(i) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(n)
If ActiveWorkbook.ProtectStructure = False Then
MsgBox "Workbook unprotected!"
Exit Sub
End If
Next: Next: Next: Next: Next: Next
End Sub- Press F5 to run the macro.
- If the workbook password uses the legacy SHA-1 hash (pre-Office 365), the macro finds a matching dummy password within seconds. For SHA-512 protected workbooks, the loop is too slow — use Method 1 instead.
Method 3 — Google Sheets round-trip
Google Sheets ignores Excel-specific workbook protection metadata. Importing and re-exporting strips the protection:
- Go to sheets.google.com and create a new blank spreadsheet.
- File → Import → Upload and select your protected .xlsx.
- Choose "Replace spreadsheet" to import the entire workbook.
- File → Download → Microsoft Excel (.xlsx).
The downloaded file has no workbook structure protection. Downside: Google Sheets may alter some formatting, drop macros (.xlsm becomes .xlsx), and has a sheet count limit. Use this method only for simple workbooks.
Method 4 — Copy sheets to a new workbook
A quick manual workaround when you only need the data:
- Open the protected workbook (it opens in read-only mode for structure operations, but the sheets are visible).
- Right-click a sheet tab and choose "Move or Copy".
- Select "(new book)" and check "Create a copy".
- Repeat for each sheet. The new workbook has no structure protection.
This works even when the workbook is protected. The protection only blocks operations on the protected workbook's own structure — copying sheets out to a new workbook is not restricted. If "Move or Copy" is greyed out, use Method 1 or 3 instead.
Unhiding Very Hidden Sheets
Excel has three sheet visibility states: Visible, Hidden (unhide via right-click), and Very Hidden (xlVeryHidden, can only be unhidden via VBA). Workbook structure protection prevents all unhiding, even via VBA.
Once you remove the <workbookProtection> element using Method 1, very hidden sheets become accessible. Open the VBA editor (Alt + F11), select the sheet in the Project Explorer, and set its Visible property to -1 - xlSheetVisible in the Properties panel. The sheet reappears in the tab bar.
Tip: Very hidden sheets are often used to store lookup tables, configuration data, or reference ranges used by formulas. Unhiding them reveals the complete data picture — but be careful not to accidentally modify data that other sheets depend on.
Workbook Protection vs File-Open Password
It is critical to distinguish between workbook structure protection and a file-open password:
- Workbook protection (this guide): The file opens, you see the content, but sheet operations are restricted. This is a hash-based gate, structurally removable.
- File-open password (also called "Password to Open" or "Encrypt with Password"): Excel asks for a password before showing any content. This is real AES encryption. None of the methods above work for this.
If Excel prompts for a password before the workbook opens at all, you need cryptographic password recovery. See our Excel password recovery guide for that scenario.
Ownership and ethics
Workbook protection is often applied intentionally to prevent accidental structure changes or to hide reference sheets from end users. Removing protection from a workbook you do not have permission to modify may violate workplace policy or terms of use. The methods described here are for recovering access to your own files when you have forgotten the password.
Frequently Asked Questions
Does removing workbook protection delete any data?
No. Removing the workbookProtection XML element only removes the lock. Sheet data, formulas, formatting, and macros are preserved exactly.
Will this work on .xls (legacy binary) files?
The XML method works on .xlsx and .xlsm only. For legacy .xls files (Office 97-2003), you need a hex editor to locate the protection bytes in the OLE2 structure, or use a dedicated tool. We recommend converting the .xls to .xlsx (if possible) and using Method 1.
What if I have both workbook AND sheet protection?
Remove both independently. Workbook protection is in xl/workbook.xml, sheet protection is in xl/worksheets/sheetN.xml files. Both elements can be deleted in the same editing session.
Can workbook protection expire or be removed automatically?
No. Workbook protection persists indefinitely unless explicitly removed. There is no expiration mechanism.
Does this work on Excel for Mac files?
Yes. The .xlsx format is identical across platforms. The XML edit method works on Mac-created .xlsx files. Copy the file to Windows for editing if needed, or use a Mac-compatible ZIP tool and text editor.
Need file-open password recovery instead?
If Excel asks for a password before the file opens at all (not after), you have a file-open password — real AES encryption. Run a free check to identify the encryption mode and get a recovery estimate.