Remove Password from Excel Using VBA [Macros] Tutorial

How to remove password from Excel using VBA as part of our continued effort to give valuable resource of learning for Excel VBA Macros tutorial students.

If you are following our blogs on a regular basis then probably you have gone through the blog where Rishabh have very clearly shown to us that how to remove excel password without any software.

Before you start, Please read this blog, Things you should know about Excel VBA

Now we will show you how to remove password from Excel protected sheet using VBA. You cannot do anything on that sheet If your excel sheet is password protected. You can only view the content of that sheet or edit on that section where it is not locked. And if there are lots of formulas are used on that sheet then you are not able to see what formulas are used on that sheet. That’s why you need to break or remove password from Excel sheet to edit or view the tricky formulas that are used in the sheet. You can also learn Excel Macros Tutorial to know the below code

Excel VBA Tutorial Course OnlineLearn Excel VBA  (Beginner To Advanced)

If you want to be a master at Excel VBA Programming language for Excel 2007, then our Excel VBA macros tutorials will make it easier for you to access it in applications such as Microsoft Office. Come create your own Macros and rule in excel.

#1: “Excel VBA Code to” technique which can be applied using google search and customizing macro to quickly use ready-made codes with little knowledge of Excel’s programming language

In one of our earlier blog, Rishabh has already has shown us how to remove the password. But here we will show you how to remove password from excel sheet using VBA. For example, you have an excel file which is password protected.  Now if you want to write something in the sheet then you will get a message that the sheet is protected….

Message-Box-in-Excel-for-Password-Protected-Sheet-Message-Picture-1

 

Now if you do not know the password then you are unable to edit anything in the excel sheet. Now to break the password of that excel we will take the help of VBA Password Remover.

Recommended Courses

Learn Remove Password From Excel and Using Excel VBA (Coding) or you can learn such more tricks. Learn More

Create Dynamic Graphs & Excel Presentation. Also, Learn how to create Data Analytic Chart & Graph. Learn More

Testimonial by spreadsheet guru
 

Steps To Remove password from WorkBook

    1. Press Alt + F11 to open VBA page
    2. Click on Insert – Module
    3. Copy the below VBA code and paste in the module

Sub BreakPassword()

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

Exit Sub

End If

Next: Next: Next: Next: Next: Next

Next: Next: Next: Next: Next: Next

End Sub

(Source: Instructable )

Unlock above code which should look like below:

Excel-VBA-Code-to-remove-Excel-Password-Picture-2 Now Press run button or F5 to run the code to remove the protection from the excel sheet. Excel sheet is unprotected. Watch the video on VBA Code Guide for excel programmingIf VBA project is protected then you need to paste the code into the module

How-to-remove-password-from-VBA-project-file-using-Excel-VBA-Picture-3

And if you don’t know the password of that VBA project then it is not possible to paste above code in the module. Break the password of the VBA project to go ahead.

Related Tutorials

Delete Duplicate in Excel or Remove Duplicate in Excel
November 9, 2018
Excel Formulas PDF
September 6, 2018
How To Lock Cells in Excel | Unprotect Excel
August 13, 2018
4x Faster at Excel
August 6, 2018
Separate Content of One Excel Cells into Separate Columns
August 3, 2018
How to Transpose Excel Columns to Rows | Paste Special Method
July 26, 2018
How to create sparklines in Excel
July 19, 2018
AutoSum in Excel with Shortcut
July 17, 2018
OFFSET Function in Excel
July 6, 2018
Strikethrough Shortcut in Excel & Word
July 4, 2018
INDIRECT Function with SUM, MAX, MIN & Independent Cell Value
June 29, 2018
Pivot Table Slicers In Excel
June 12, 2018
How to Split Cells in Excel using Text to Column
June 7, 2018
How to Wrap Text in Excel Automatically and Manually
June 6, 2018
How to Hide/Unhide Column in Excel
June 5, 2018
Highlight row based on cell value
June 4, 2018
Learn how to remove blank cells in Excel
June 3, 2018
How to Group Numbers, Dates & Text in Pivot table in Excel
June 1, 2018
5 Powerful Tricks to Format cells in Excel
May 31, 2018
Insert a Picture into a Cell in Excel
May 25, 2018
What is ISFORMULA Function and FORMULATEXT Function
May 21, 2018
How to Use SUBSTITUTE Function
May 21, 2018
Excel Quartile Function in Excel
May 8, 2018
How to use the Excel PERCENTILE function
May 7, 2018
Insert or Type degree symbol in Excel with Autocorrect Feature
May 7, 2018
25% Discount
No prize
All Courses at $200
Almost!
10% Discount
Free Ebook
No Prize
No luck today
Almost!
50% Discount
No prize
80% Discount
Get a chance to boost your knowledge!
Use this coupon code for any course that you wish for. 
Our in-house rules:
  • You can choose any course & redeem coupon
  • If you find any difficulty, mail us on [email protected]
  • Wheel Spin will end soon
  • Coupon code can be applied within 2 days.