Lost password

  • Thread starter Thread starter Neil
  • Start date Start date
N

Neil

Hi all, and good evening.

Some time ago I set up a spreadsheet, and password protected one of the
worksheets.

Yup, you guessed it! I have been and forgotten the password! I can open the
file, but cannot unprotect the sheet in question.

Any ideas muchly appreciated.

Regards

--
Neil

Yesterday is a memory
Tomorrow is but a vision
Today is just a bitch!
 
Neil

put this code in a module in the VBA Editor. Select the sheet. Run the
macro. voila

Sub BreakIt()
Dim i As Integer, j As Integer, k As Integer, 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 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 useable 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

Regards

Trevor
 
Eva

One of the lad at work had a little ditty to crack the password, so sorted
from there.

Thanks for the tip - would have been my last resort!

Regards

--
Neil

Yesterday is a memory
Tomorrow is but a vision
Today is just a bitch!
 
Back
Top