Unprotect workbook without password

0 votes

I have a popular VBA code to unprotect a worksheet, but I am still running into the issue that the Workbook is protected.

Sub PasswordBreaker()
'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

Apr 7, 2022 in Database by Edureka
• 13,690 points
504 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
1 answer

Access HFile without using Hbase

Yes, it's very much possible to access ...READ MORE

answered Aug 9, 2018 in Database by kurt_cobain
• 9,350 points
768 views
0 votes
1 answer

Reset system administrator password - MSSQL Server on Linux

Execute the following two commands: sudo systemctl stop ...READ MORE

answered Mar 17, 2019 in Database by Fatima
1,185 views
0 votes
1 answer

Access progrs prompt without switching accounts

Use the following to get the postgres prompt ...READ MORE

answered Mar 22, 2019 in Database by Mahi
858 views
0 votes
1 answer

Can't connect to mysql server in workbench. Kindly please support. username: root & Password: 1234 (i gave)

Hey, @Arivukani, You can see once thing, the solution ...READ MORE

answered Mar 30, 2020 in Database by Gitika
• 65,770 points
1,801 views
0 votes
1 answer

Merging Two excel files as two sheets in one workbook in java

Basically for this, you need to create ...READ MORE

answered Feb 21, 2022 in Database by gaurav
• 23,260 points
1,096 views
0 votes
0 answers

How to import JSON file to Excel without coding?

Let's say you have a file named input.json which ...READ MORE

Feb 24, 2022 in Database by Edureka
• 13,690 points
799 views
0 votes
1 answer

Number of elements in a single dimension variant array in excel

You must do UBound - LBound + ...READ MORE

answered Mar 24, 2022 in Database by gaurav
• 23,260 points
793 views
0 votes
1 answer

Pasting an Excel range into an email as a picture

Hold down the ALT + F11 keys ...READ MORE

answered Mar 30, 2022 in Database by gaurav
• 23,260 points
4,776 views
0 votes
1 answer

#NAME? error in Excel for VBA Function

Because you have a module with the ...READ MORE

answered Apr 5, 2022 in Database by gaurav
• 23,260 points
1,471 views
0 votes
1 answer

Excel vba for loop

You must understand how to use loops ...READ MORE

answered Apr 5, 2022 in Database by gaurav
• 23,260 points
709 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP