Excel Worksheet Pasword Breaker – VBA

If there is one thing that would make you think twice before resorting to Excel for Applications, its the security concerns in Excel.

Excel is known mainly for its user-friendliness, but in the process, it compromises on Security. In order to use it as a database, or anything else, you would definitely not be able to prevent a third party from accessing your data or codes if they wanted to!

There are two ways to maintain a minimum level of security. If yours is only an Excel sheet, you can try to Password Protect your file, but this is easily broken by even a small code in VBA, that I’d found some weeks back during my search for Password Breakers.

This author of this code is unknown, and hence I have no issues in putting it up here. I have not tried this code yet, and so this is only meant for information purposes and you are fully responsible for your actions.


Sub PasswordBreaker()
‘Author unknown
‘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

There is yet another way to secure your worksheets, and that would be to use VBA Password Protect. From what I had read on the web, I found that VBA security is a little more secure than its counterpart, as in it cannot be broken easily, yet it can be broken nevertheless if one wishes to do so. And there are umpteen softwares available for that, a simple brute force would do!

But what was even more alarming was that, if only you just copied the sheets (if unprotected) into a new workbook, you could actually even compromise on VBA security!!!! I had never expected this, and stumbled on this when I was trying to desperately break one of my own passwords that I forgot! I am not sure if this is a glitche, or if there is some other way round it, and if there is, I request you to put it up here.

With the vast resoursefulness of Excel, and its many many applications, if only it can be made a little more secure, it could be the solutions to many!

I have been having a lot of exposure into EXCEL VBA & RibbonX, and more importantly, I’m also venturing into the Outlook VBA. I shall come up with all these in the subsequent posts.

P.S. I have changed the look & feel of my blog for a lot of reasons, and will not contain pages of other interesting areas like Finance. I will also be putting up the references to the best sources along with a brief summary to help you find the right info @ the the right source in no time. My downloads, as well as Downloads from Others(intended for free circulation) shall be in the Downloads page.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s