Friday, June 1, 2012

Unprotect a password protected Excel worksheet

Just wanted to share how easy it is to unprotect or unlock a password protected Excel 2007 or Excel 2010 worksheet.  It can come in handy when you need to edit your password protected worksheet but has forgotten the password.
Remember that Office 2007/2010 is using Open XML format which is a zipped XML format.  To unprotect the Excel file without knowing the password, just follow the steps below.
Rename the file extension from xlsx to zip.
Use a zip tool (e.g. 7-zip, Winzip) to open the file.  Go into the xl folder.

  Then go into the worksheets folder.

Right click on the worksheet you want to unprotect and select edit.

Look for the sheetProtection tag.  Note that the password has been hash so it is not the real password.  To unprotect the worksheet, you can choose to delete the entire tag which will make the worksheet unprotected or you can set an empty password.
Protected with a password

Protected with empty password

If you choose to set an empty password, the worksheet is still protected but you can unprotect it in Excel without entering any password.
After making the change, save and close the editor (e.g. notepad).  When prompted whether to update the archive, select “Yes”.
Rename the file extension from zip back to xlsx.  Open the Excel file and you can edit the previously protected worksheet.


No comments: