How to unprotect the excel sheet if forgot the password

New Contributor

Hi team need support to unprotect my sheet which is password protected and forgot the password

 

182 Replies

@NikolinoDE  The code ran okay. I received the "Finished" message box, but the active sheet was still locked. I do not understand how the code can work when 10 characters cycle between A and B and only the last character cycles between all of the keyboard characters.

 

Thank you,

Andy

This worked for me: unzipping file, removing sheetProtection XML tags from the sheetN.xml files and zipping files again, as per Damo_S post.

 

Unfortunately, the VBA code approach completed but didn't succeed in unprotecting the sheet.

@Deleted Try this. Save the workbook as an Excel 97-2003 Workbook and then run the code. That worked for me.

 

Andy

@NikolinoDE 

Old thread: hoping someone sees this.  I have run this macro, but keep getting Compile Error, Syntax Erro on the following:  .Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & _

 

I've got a workbook with multiple locked cells, and the person with the p/w lives on Sanibel Island... and I'm trying to finish our budget.   

Thanks!

david

@David_DSHill 

 

Put all that code on one line and remove the underscore.

 

Andy

@Andy_R_327 

 

Thanks, Andy.  Caught that right after I posted.   Ran, but no results - never got the Finished, message, though.   I also noticed the Protection uses SHA-512 and not AES-128, so perhaps not going to give an answer?  Weird part is task manager shows almost zero CPU usage.  Not sure what is going on.

 

thanks,

 

David

@David_DSHill 

 

Did you save the workbook as an Excel 97-2003 workbook before you ran the macro?

 

 

Andy

@Andy_R_327 

 

Hey Andy, 

 

Thanks.  Yes, I saved it as a xls (97-2003) file first.  That is why I am flummoxed.  It should at least push the Finished msg box or fail.  It just stays silent. 

thanks/David

@NikolinoDE 

I just came across this code today.  One additional question.  I have a password on the workbook and have a tab hidden.  I need to update the lists on that hidden tab for my data validation drop down lists.  I have opened the page with the data validation, but I cannot access the back-up list.  

 

Is there a version of this code that removes the password from the entire workbook?

 

Thank you in advance for your assistance.

 

Christina

Not that I know of. Try Google.

Andy

@vedangbapna 

 

Excel provides a simple method for locking and protecting your workbooks and worksheets with a password. But what happens if you lose these passwords or forget them first? If this unfortunate event has befallen you, the good news is that Excel provides many paid and unpaid options for re-protecting and unprotecting excel workbooks. This information is relevant for Excel workbooks created in Microsoft Excel 365, Microsoft Excel 2019, Microsoft Excel 2016, and Microsoft Excel 2013.

 

How to Unlock Excel Workbook Without Password? (Free 3 Method)

 

1. VBA Script

Sub PasswordBreaker() Dim i As Integer, j As Integer, k As Integer Dim l As Integer, m As Integer, n As Integer Dim i1 As Integer, i2 As Integer, i3 As Integer Dim i4 As Integer, i5 As Integer, i6 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 i1 = 65 To 66 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _ Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) If ActiveSheet.ProtectContents = False Then MsgBox "One usable password is " & Chr(i) & Chr(j) & _ Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _ Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) Exit Sub End If Next: Next: Next: Next: Next: Next Next: Next: Next: Next: Next: Next End Sub

 

If the above script is not work don't worry. Please try second method as shown below.

2. How to Unprotect the Workbook Using Software?

You can Also Unprotect the Workbook Password Using the Technique Below

You will require a hex editor for this.

 

Step 1- Find the “DPB” string in the file and replace it with “DPx” using a hex editor.

Step 2- If you are attempting to unlock a file with the extension.xls or .xla, you must first open the file in your hex editor and search for the text string “DPB”:

Step 3- All you need to do is change the “B” in DPB with an “x” by clicking on it.

Step 4- Save before exiting your hex editor. Learn More

3. How to Unprotect the Workbook Using Excel Add-in?

In addition, an add-in can remove protection from a workbook or worksheet even if the password is forgotten.

 

After opening your working file, which is protected by a password, open the add-in file and click on “worksheet password delete”.

 

Clicking the button labelled “delete workbook password” is what you have to do to get rid of the password for the workbook.

 

I hope you know how to protect and unprotect excel sheets/workbooks in different methods. You can also use many paid or free services to unlock the excel sheet. But remember to know the consequences before choosing any tool/trying out methods.

@NikolinoDE 

I have the same problem

I could not attach the file you can help me remove the password protection on the cells. I can email you the file. 

My email is email address removed for privacy reasons 

You can Also Unprotect the Workbook Password Using the Technique Below
You will require a hex editor for this.



Step 1- Find the “DPB” string in the file and replace it with “DPx” using a hex editor.

Step 2- If you are attempting to unlock a file with the extension.xls or .xla, you must first open the file in your hex editor and search for the text string “DPB”:

Step 3- All you need to do is change the “B” in DPB with an “x” by clicking on it.

Step 4- Save before exiting your hex editor. Learn More

@NikolinoDE I just tried this on my iMac.  I thought it was going to work, but I got a syntax error message.  Do you know if the code would be different for the Mac OS?  Thank you!

I have no idea. I hate Macs!

@NikolinoDE It has done the miracle. Thanks

Sir you're information is golden and saved me as well as some of colleagues a great amount of time!
Glad I could help!

@NikolinoDE You are remarkable.  This worked for me.  Phew!  Only took a few seconds.  Thanks!

@NikolinoDE could you please help me with this? I don’t see what to the right was to be copied and pasted. I have an excel chart that’s about 3 years old I just found and needed some info off of it; but  I can’t remember the password for it.  any other tips would be appreciated! For full disclosure I’m not a developer or IT expert by any stretch of the imagination.