Skip to main content

How to unlock excel worksheet

Sometimes you keep an excel worksheet with a password to keep confidential, and sometimes you forget the password. Here I will explain how to open the locked excel worksheet.
The first step, open the excel file that is locked and press alt + f11. then double clik on the sheet do you want unlock
see the picture below



And then copy this code

Insert the code below in the general declarations page you have opened.
You should not have to change anything , sheet name etc... Just copy and 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
_____________________________________________________________________


Once the code is added run the Macro by selecting Run from the menu tab bar at the top of the VBA editor screen or simple press F5





The macro will return you to the worksheet you want to unprotect. An alert style box will appear with a usable code. In the Review menu tab click Unprotect sheet. Enter the generated code as the password and your done. Your sheet should be unlocked!

You should use this power wisely and responsibly only to unlock your own worksheets.

Reference: here (to many web explain this code and i don't know who create this code)

Comments

Popular posts from this blog

How to disable Autoconfiguration IPv4 Address

How to disable Autoconfiguration IPv4 Address Sometime your windows get error, they can not connect to the internet or appear a message likes "conflict IP address" Enter: Run > cmd > ipconfig /all You may see the following issues: To fix it, enter these from Command Prompt: netsh interface ipv4 show inter netsh interface ipv4 set interface xx dadtransmits=0 store=persistent change xx with idx number your local area connection ( 11 for my case ) then restart your computer. If you want to disable DHCP Client: Run > services.msc > disable DHCP Client service note: if you disable DHCP Client, your computer cannot get ip from DHCP Server. You must setup your IP manually.

Virus ".micro File Extentions"

.micro virus....!!! yeah.... this is ransomware virus (such as crytolock in 2015). This virus make all your file ( such as document,photo etc) turned to " .micro File Extentions " and make that's file unable to accessed/opened. It has encrypted your files and now they want money to give you the unlock key. This virus ( .micro File Extension) is a very harmful infection that silently infiltrates into targeted windows computer without seeking for any approval and hides itself behind the system background. You won’t recognize its arrival as it infiltrates very secretly and via various internet sources. Below some of the common source are discussion that makes invasion of harmful parasites into compromised machine. Social Media : Visiting malicious websites, unsafe web pages, phishing domain and unauthentic web pages are the major ways for the invasion of creepy computer threats. Drive By Download : This very malware usually comes bundled with freeware software installe...