Skip to main content

How to unprotect an Excel sheet if password is unknown

If an Excel spreadsheet is password protected, we are unable to edit the data in the sheet. If you do not remember the password or if you don't know the password to unprotect the excel sheet then just follow this process for unlocking the excel sheet.

Step 1: 

Open the Excel sheet

Step 2:

Press Alt + F11 or click on view code on the developers tool
Then you would be seeing a sheet like this

Step 3:

In the above white space, just enter the code as shown below(Just Copy paste)

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


Step 4:

Now Click on F5 to run the code



and there youo get the unprotected excel sheet.
Now you get a message containing the password which can be ignored.


Do visit my blog for further updates.......

Back to MS Excel>>

Comments

Post a Comment

Popular posts from this blog

How To Merge Two Separate Schedules Into One Master Schedule In Primavera

In this tutorial, let us learn how to Merge two separate schedules into One Master schedule in Primavera P6. In this example, I am considering two separate projects which are these two, One is master schedule and one is the subproject. First, let us open the subproject and export this schedule as a .XER file onto Desktop. and now let us start the exact process of merging two separate schedules. 1. As a first step, We need to open the project schedule into which we want to insert the other project as a sub-project. So, let us open the Master schedule here. 2. Go to Import, select XER format, Click Next 3. Select Project and click Next 4. Now select the Subproject .xer file from the Desktop and click Next 5. Under Import action, select the option as “Update Existing Project” and under import to section, select the Master schedule which is already open. Click Next and Finally Click on Finish. 6. Please note and make sure that your WBS and activity IDs should not confl

Top 4 Useful Features, Tricks You Can Use In Primavera P6 || Special features To Learn In Primavera

1. How to Increase the size of icons in Primavera P6?  If you find that the menu bar and command icons are of less visibility, there is a way to increase the size of icons in Primavera P6. Let us see how to do this in this tutorial now. Go to the menu bar and under the view tab, select Toolbars and click on customize. Now a window gets opened like this, go to options tab and tick the checkbox "Large Icons". Click on the Close button and you can see that all your icons now increased in size. 2. How to Animate your Menu Bars in Primavera P6? You know that we have got the option to animate menu bars in Primavera P6. There are 4 animation options in Primavera P6, These are None  Random  Unfold Slide  Fade  You can try any of these if you want a new feel. Follow this steps to Animate Menu Bars. Click on View, go to toolbars, select Customize. Now a customize window will pop up. Go to the options tab, at Menu Animations: Check on Drop Down Bu

How to adjust the Legend Space in Microsoft Project

In this Tutorial, let us see how to adjust the space occupied by the Legends in Microsoft Project, enabling for a better professional print of the schedule. Step - 1: Open the Microsoft Project schedule and go to File>>Print Preview>> Step - 2: At the bottom of the print preview, you can view the Legend portion. Sometimes the legend space occupies the major portion of the page, making it unprofessional to print the schedule reports. Step - 3: So, in order to adjust this legend space,you need to go back to the schedule's Gantt chart view and place the cursor at the gantt chart and right click to select the Bar styles option. Step - 4: Here, you can view all the Legend Labels. Now start entering the symbol asterisk * at the beginning of all the labels which you intend not to reflect in the print view as shown here Now here is the Schedule layout with minimum & only required legends Step -5: Now, in addition to the ad