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.5 : Budgets

Budget Consists of quantities and cash flow required to complete a project. In the Planning stage project manager and other stakeholders need to estimate scope and budgets. As the scope changes, budget also needs to be adjusted to compensate. Primavera is helpful in establishing these budgets and tracking the changes in the budgets. In this Tutorial, let us learn how to establish budgets, establish monthly spending plans, implement changes to it and tracking monthly spending and variances right from EPS to Project and to WBS level. In the planning stage, we start the budgeting from the top level, like dividing the budget available to the EPS nodes for the duration of the projects. And then respective managers divide this budget to the projects for which they are responsible in each EPS node. Let us consider with an example here. Considering that we have $6000 allotted for an EPS node and it is having two projects and we divide this $6000 equally to these two projects as $3000 eac...