Pages

10/03/2013

Unlock Protected Excel File

For .XLS 


1. For protected excel file that has VBA disabled.
open any hex editor tool
search for "DPB", then change it to "DPx"
save and open the file normally.
Excel will say the file is a little corrupted, but it is fine. Just need to save and re-open it again.

2. After the enable VBA on the file, if the sheet or workbook is protected.
open the file
press ALT + F11 to open VBA
right click on module folder to create a new module (not class module)
copy the code from http://www.zorvek.com/excel/unlocking-workbooks-and-sheets.htm and paste in the module.

2.1 To unlock the sheet
switch to excel window
open the protected sheet
then switch back to VBA window
click mouse to have the cursor inside "UnlockSheet()" sub-module
click F5 to run
the popup will appear, just close it, and you'll have the unlocked sheet

2.2 To unlock the workbook
do the same as 2.2, but have the cursor inside "UnlockWorkbook" sub-module instead.

3. Unlock Macro/VBA Source Code
Even the VBA window can be displayed with ALT+F11, you can't really go to see the existing code in each macro.
It will pop-up error as "Unexpected error (40230)"
The way to fix it is right click at any macro file in VBA window
select "VBAProject Properties..."
go to "protection" tab
check at "Lock project for viewing"
set the password as you will remember
then OK, and save, and close the file
re-open the file, go to VBA window again,
unlock it with your password
Now you'll be able to read all the source code.
And you probably need to go to "VBAProject Properties..." again to uncheck "Lock project for viewing".

For .XLSX


rename the file extension from .xlsx to .zip
go inside to xl\worksheet subfolder
there will be sheets in their separated XML files
open the protected one with a text editor (e.g. notepad)
search and find the line that says "<sheetProtection password=......../>" and delete this whole tag.
save the file
zip it back, then rename it back to .xlsx


For .XLSM


found this way to go inside .XLSM zip file then replace the password hash with the password "macro"
http://lbeliarl.blogspot.com/2012/12/for-excel-20072010.html

2 comments:

  1. Open Excel file by password removal with the use of advanced eSoftTools Excel password remover software. This is best solution available for successfully unlock xls, xlsx, xlsm, xltm, xla, xlam and xlsb files.

    Read More
    http://www.excelunlocker.esofttools.com

    ReplyDelete
  2. Try Excel Password Recovery is a great way for recovering forgotten Excel file password and unlocking locked MS Excel file then you can effortlessly read in MS Excel file.

    ReplyDelete