ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Remove Excel worksheet protection



  Tappd'd RS
Hi Guys,

I've got a spreadsheet at work with protected sheets - we need to make changes to it but the person who created it has now left the business and we don't know the password!

Can anyone recommend a utility to find the password / break it?

Cheers.

Alan
 
1. Open your spreadsheet.
2. Hit ALT+F11 (to open the VBE, Visual Basic Environment)
3. On the menubar go to "Insert|Module"
4. copy and paste the supplied code into the new window that just appeared.
5. Hit ALT+F11 to return to the spreadsheet.
6. Hit ALT+F8 to get the Macro dialogue box up.
7. double click on the name "PasswordBreaker" in the list box.

The macro will tell you an equivalent password, e.g. "AAAAAAAABBA", but the main thing is is that the sheet is no longer password protected.
 
Sub PasswordBreaker()



'by Black-Clio-1.4

'Made 2008

'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)

Application.StatusBar = 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)

Application.StatusBar = False

Exit Sub

End If

Next n

Next i6

Next i5

Next i4

Next i3

Next i2

Next i1

Next m

Next l

Next k

Next j

Next i

Application.StatusBar = False

End Sub
 


Top