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...

Primavera P6 Export To Excel And Color WBS Levels Automatically || How To Color WBS Levels

In this tutorial, let us learn how to Color WBS levels after Primavera P6 Export To Excel. After exporting activity table from Primavera P6 to Excel, it’s very hard to tell which activity belong to which WBS. So in this tutorial, let us see how to color WBS levels automatically so we can have a report like in Primavera P6. This is my sample schedule in primavera, 1. I press Ctrl+A to select entire data and copy the data and then go to Excel sheet and paste it. 2. Add a column left to Activity Id i.e column A and name it as WBS level to show the WBS level for each activity. 3. enter the formula in Cell A2 as = =((FIND(TRIM(B2),B2))-1)/2 4. Hit enter and then apply the same formula to all the cells in column A to see WBS level for each activity. 5. See now, you can view the WBS level for each activity this way easily in Excel after exporting the Primavera P6 Schedule. And Now let us color the WBS levels. 1. Select the entire Data range. 2. Go to Conditional F...

Primavera P6 Tutorial : Chapter 2.7 : User Defined Fields

Apart from the in-built fields available in primavera, you can create User-defined fields which enable you to customize fields and values and add them to the project database. For example, you can use them to track additional activity data such as ordered dates, delivery dates, revised budgets, purchase order / work order numbers, vendor names, etc. In this chapter, let us learn how to create User defined fields, how to work with them and how to work with indicators type of User defined fields. How to Create UDFs? For each custom user defined field you create, you can specify any of the following data formats for that field: Text, Start Date, Finish Date, Cost, Integer, Number, Text, and Indicator. To Define: Go to the Menu bar, Choose Enterprise, select  User Defined Fields . Select the subject area to which you want to add a new field, then click  Add . Double-click in the Title column and type a name for the User Defined Field. Double-click in the Da...