Civil Engineering Association

Full Version: Excel Worksheet Password Recovery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Here is simple routine to recover password for worksheet (not the file password) and unprotect worksheets

-----------------------------------cut below this line------
Sub PasswordBreaker()
'Author unknown
'Breaks worksheet password protection.
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
-----------------cut above this line-----------------
Procedure:
start excel
open the excel file you need to unprotect
Start Visual Basic Editor: Tools -> Macro menu -> Visual Basic Editor
Create a new module : Insert -> module
Paste the above code in the module
Close Visual Basic Editor
Run the Macro named "PasswordBreaker" from Tools -> Macro menu
This will give you a password that you can use to unprotect a worksheet
If you have multiple worksheets, you need to run the macro in each worksheet.

Enjoy
Babo G
I have tried out but it does not work. Can others who have tried out and feed back? Thanks!!
ya i have tried and its working for me..
99richard
Works perfectly.
Dear All,

another alternative:

Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

Regards

Dell
dear babog
ur subroutine works fine in some worksheets but sometimes it does not break all sheets if there are number of worksheets in a single excel file.. plzz update ur code if u can..
hi

i have used straxx addin for 2 yeras and they solved my problems

regards
Yasir : You have to run it in every sheet

Dell brett & Mig21 : Could you please provide the "password.xla" file which can be used in Excel 2007 and higher ? Thanks in advance.

:wacko2:
When i have a excell worksheet protected whith a pass, first of all i trie to open it whith openoffice, in most cases the "excell" of openoficee breaks all the the pass.

All you have to do is open a xls paper in rhe openoffice, noything else.
code works perfectly

abhijit
Pages: 1 2