• Home  / 
  • VBA
  •  /  Remove Password from Excel Using VBA [Macros]

Remove Password from Excel Using VBA [Macros]

Remove password from Excel meme
In this blog, we will try to cover how to remove password from Excel using VBA as part of our continued effort to give valuable resource of learning for Excel VBA 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. You have not gone through the earlier then please click on the below link:

“God Mode” trick to remove Excel password – No Software or Google needed

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.

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

Dialog box for Remove password from Excel

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.

Follow Remove password from excel sheet you need to do the following:

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

Watch video on VBA Code Guide for excel programming

(Original code is from http://www.instructables.com/id/VBA-Code-To-Unlock-A-Locked-Excel-Sheet/step2/Cut-And-Paste-The-Code-Breaker/)

Your code should look like below

       (Picture 2)

(Picture 2)

Now Press run button or F5 to run the code to remove the protection from the excel sheet. Excel sheet is unprotected.

If VBA project is protected then you need to paste the code in the module

Remove password from Excel from VBA Protected Sheet

(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. Now how will you remove the password of the VBA project? We will cover that part in our upcoming blog.

Please let us know your feedback and give comments. Download the Excel Macro code file from here and check the code.

Comment below regarding Userform

About the author

Niladri Sekhar Biswas

Hi, I have 9 years of experience working in Microsoft Excel. I am also an Excel and VBA corporate trainer. Writing about Excel and sharing my knowledge is my passion. I hope you learn more about Excel from my articles.