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!
 
Copy all the data and paste it into a new sheet; the new
sheet will be unprotected.
 
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Lost My Password 3
Password protected and shared workbook 1
Lost Protection Password 2
Password Protection Bug 2
Forgot the Password 2
Password and Macro 4
Protected Sheets 2
Macro Passwords 2

Back
Top