Your Trust, Our Growth
Training

https://comtechsolution.blogspot.in/

My Tech Blog

By: COIN | March 03, 2013

Open the password protected Excel Worksheet then 
  1. Go to View > Macros.
  2. Click on Record Macros > Ok.
  3. Then go to View > Macro again and click Stop Record > Ok.
  4. Then click on View Macros under View > Macro.
  5. You will find a Macro with a default name Macro1.
  6. Select the Default Macro > Edit.
  7. A Visual Basic Editor will open 
  8. Replace the Default Code with the code mentioned Below.
Sub Macro1()
'
Const DBLSPACE As String = vbNewLine & vbNewLine

Const AUTHORS As String = DBLSPACE & vbNewLine & "Adapted from Bob McCormick base code by" & "Prakhar http://http://comtechsolution.blogspot.com/"

Const HEADER As String = "AllInternalPasswords User Message"

Const VERSION As String = DBLSPACE & "Version 1.0 8 Mar 2013"

Const REPBACK As String = DBLSPACE & "Please report failure to prakharclall@gmail.com "

Const ALLCLEAR As String = DBLSPACE & "The workbook should be cleared"

Const MSGNOPWORDS1 As String = "There were no passwords on " & AUTHORS & VERSION

Const MSGNOPWORDS2 As String = "There was no protection to " & "workbook structure or windows." & DBLSPACE


Const MSGTAKETIME As String = "After pressing OK button this " & "will take some time." & DBLSPACE & "Amount of time " & "depends on how many different passwords, the "



Const MSGPWORDFOUND1 As String = "You had a Worksheet " & "Structure or Windows Password set." & DBLSPACE & "The password found was: " & DBLSPACE & "$$" & DBLSPACE & "Note it down for potential future use in other workbooks by " & "the same person who set this password." & DBLSPACE & "Now to check and clear other passwords." & AUTHORS & VERSION

Const MSGPWORDFOUND2 As String = "You had a Worksheet " & "password set." & DBLSPACE & "The password found was: " & DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & "future use in other workbooks by same person who " & "set this password." & DBLSPACE & "Now to check and clear " & "other passwords." & AUTHORS & VERSION

Const MSGONLYONE As String = "Only structure / windows " & "protected with the password that was just found." & ALLCLEAR & AUTHORS & VERSION & REPBACK

Dim w1 As Worksheet, w2 As Worksheet

Dim i As Integer, j As Integer, k As Integer, l As Integer

Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer

Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer

Dim PWord1 As String

Dim ShTag As Boolean, WinTag As Boolean

Application.ScreenUpdating = False

With ActiveWorkbook

WinTag = .ProtectStructure Or .ProtectWindows

End With

ShTag = False

For Each w1 In Worksheets

ShTag = ShTag Or w1.ProtectContents

Next w1

If Not ShTag And Not WinTag Then

MsgBox MSGNOPWORDS1, vbInformation, HEADER

Exit Sub

End If

MsgBox MSGTAKETIME, vbInformation, HEADER

If Not WinTag Then

MsgBox MSGNOPWORDS2, vbInformation, HEADER

Else

On Error Resume Next

Do 'dummy do loop

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

With ActiveWorkbook

.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 .ProtectStructure = False And .ProtectWindows = False Then

PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

MsgBox Application.Substitute(MSGPWORDFOUND1, "$$", PWord1), vbInformation, HEADER

Exit Do 'Bypass all for...nexts

End If

End With

Next: Next: Next: Next: Next: Next

Next: Next: Next: Next: Next: Next

Loop Until True

On Error GoTo 0

End If

If WinTag And Not ShTag Then

MsgBox MSGONLYONE, vbInformation, HEADER

Exit Sub

End If

On Error Resume Next

For Each w1 In Worksheets

'Attempt clearance with PWord1

w1.Unprotect PWord1

Next w1

On Error GoTo 0

ShTag = False

For Each w1 In Worksheets

'Checks for all clear ShTag triggered to 1 if not.

ShTag = ShTag Or w1.ProtectContents

Next w1

If ShTag Then

For Each w1 In Worksheets

With w1

If .ProtectContents Then

On Error Resume Next

Do 'Dummy do loop

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

.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 Not .ProtectContents Then

PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

MsgBox Application.Substitute(MSGPWORDFOUND2, "$$", PWord1), vbInformation, HEADER

'leverage finding Pword by trying on other sheets

For Each w2 In Worksheets

w2.Unprotect PWord1

Next w2

Exit Do 'Bypass all for...nexts

End If

Next: Next: Next: Next: Next: Next

Next: Next: Next: Next: Next: Next

Loop Until True

On Error GoTo 0

End If

End With

Next w1

End If

MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER
'
End Sub

9. Now Run the Macro and you will get the password of the  
   protected Excel Worksheet.





Comments:

huis te koop Spanje

Posted on : June 27, 2019

Feeling tired of Bachelor life ! Find your True Love today. Perform our Strong Dua For True Love, to get your True and pure love partner today. Our Dua is very powerful and it fill Fill your empty life with True Love. Consult our famous Molvi sahib for Dua For Love and Attraction.


hvac st louis

Posted on : June 26, 2019

Awesome Information sharing .. I am extremely cheerful to peruse this article .. much obliged for giving us experience info.Fantastic decent. I value this post


one piece lingerie

Posted on : June 25, 2019

This web journal is truly awesome. The data here will definitely be of some help to me. Much appreciated!.<a href="https://www.musotica.com/collections/plus-size">one piece lingerie</a>


vintage store

Posted on : June 18, 2019

Hey what a splendid post I have gone over and trust me I have been hunting out down this comparable sort of post for recent week and scarcely ran over this. Much thanks and will search for more postings from you.<a href="https://www.blue17.co.uk/">vintage store</a>


Costumesrock

Posted on : May 14, 2019

I did a survey about Yolanda's Cafe, and so far, most of them are positive. So maybe they only need improvement,​Best hologram and not major changes. <a href="https://costumesrock.com/decades/60s-costumes.html">Costumesrock</a>


wholesale clothing

Posted on : May 12, 2019

Although I would be thrilled to take the first tour you described, it would be worth the trip to see the Mt. Desert gardens alone. If I could get away, I would definitely attend. Perhaps there will be another time.<a href="https://www.mezonhandbags.com/">wholesale clothing</a>


device onboarding

Posted on : May 07, 2019

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work <a href="https://www.afero.io/iot/device-onboarding/">device onboarding</a>


sexy plus size lingerie

Posted on : April 17, 2019

The post is written in very a good manner and it contains many useful information for me.<a href="https://www.musotica.com/collections/plus-size">sexy plus size lingerie</a>


tree removal long island

Posted on : April 11, 2019

This is a splendid website! I'm exceptionally content with the remarks!.. <a href="https://www.aaatreeserviceny.com/tree-services-long-island/">tree removal long island</a>


vintage shops near me

Posted on : April 07, 2019

I am unquestionably making the most of your site. You unquestionably have some extraordinary knowledge and awesome stories.<a href="https://www.blue17.co.uk/">vintage shops near me</a>


ac maintenance agreements

Posted on : March 05, 2019

That has all the earmarks of being magnificent anyway i am still not very beyond any doubt that I like it. At any rate will look much more into it and choose by and by! https://ricottaheatingandair.com/air-conditioning/ac-maintenance-agreements/


Ghana Business News

Posted on : February 20, 2019

I wish more writers of this kind of substance would take the time you did to look into and compose so well. I am exceptionally inspired with your vision and understanding. <a href="https://www.newsghana.com.gh/">Ghana Business News</a>


post pounder

Posted on : February 07, 2019

I wish more writers of this sort of substance would take the time you
did to look into and compose so well. I am extremely inspired with your
vision and knowledge.<a
href="https://www.deerfenceusa.com/ecommerce/fence-post-pounder.html">post pounder</a>
<br />


akram khatri

Posted on : January 09, 2019

I should say only that its awesome! The blog is informational and always
produce amazing things. <a
href="http://www.thehiddenpages.com/escorts-from/los-angeles-escorts/">Los
Angeles Escorts</a>
<br />


akram khatri

Posted on : December 25, 2018

You possess lifted an essential offspring..Blesss for using..I would
want to study better latest transactions from this blog..preserve
posting.. <a href="https://www.woocasite.com/">온라인카지노</a>
<br />


akram khatri

Posted on : December 18, 2018

I propose merely very good along with reputable data, consequently
visualize it: <a href="http://ufabig.com/">แทงบอล</a>
<br />


akram khatri

Posted on : December 12, 2018

I simply want to tell you that I am new to weblog and definitely liked
this blog site. Very likely I’m going to bookmark your blog . You
absolutely have wonderful stories. Cheers for sharing with us your blog.
<a href="http://www.livkind.net/">relaxation</a>
<br />


Rakan

Posted on : December 11, 2018

I think this is a really good article. You make this information
interesting and engaging.<br />
<a
href="http://123multiplayergames.com/games-news/top-multiplayer-games-ios-android-app-store-free.html">multiplayer
games in app store free</a>
<a></a>


akram khatri

Posted on : December 03, 2018

I propose merely very good along with reputable data, consequently
visualize it: <a
href="https://style-by-yvs.nl/lifestyle-by-yvs/gedrag-en-communicatie/workshop-disc/">DISC teamworkshop</a>
<br />


akram khatri

Posted on : December 02, 2018

This is important, though it&#39;s necessary to help you head over to it
weblink: <a href="https://fofo100.xyz">우리카지노</a>
<br />


Bradley Knuckles

Posted on : November 17, 2018

Thanks for sharing the information. Keep the good work going. <a
href="https://ablefarmscbdoralspray.tips/">Able farms cbd</a>
<a href="https://vtightgel.tips/">v tight gel</a>
<a href="https://xylamgarcinia.tips/">Xylam Labs Garcinia Cambogia</a>


seomaster

Posted on : October 22, 2018

You ought to basically fantastic not to mention solid advice, which
means notice: <a href="https://www.argohomesflorida.com">florida</a>
<br />


USTAD

Posted on : October 14, 2018

This is exciting, nevertheless it is vital for you to visit this
specific url: <a
href="http://www.starbuild.it/professionisti/BS/roncadelle/rifacimento-bagni">Preventivo
rifacimento bagno</a>
<br />


Anonymus

Posted on : July 22, 2018

Doubtlessly this is an amazing post i got a great deal of learning in
the wake of perusing good fortunes. Topic of online journal is
phenomenal there is very nearly everything to peruse, brilliant post.
<a href="https://www.miniproreviews.com">https://www.miniproreviews.com</a>
<br />


Linda Rose

Posted on : June 14, 2018

Very helpful advice in this particular post! It’s the little changes
that make the largest changes. Thanks for sharing!<br />
<a href="http://vfgdfgd.com">fsfjishf</a>
<br />


HADAR

Posted on : April 29, 2018

Why do only so much written on this subject? Here you see more. <a href="https://www.languageofdesires.com/11-ways-tell-woman-horny-instantly">Horny</a>
<br />


OVIDIO

Posted on : April 29, 2018

I like to recommend exclusively fine plus efficient information and
facts, hence notice it: <a href="https://www.relationshipeguide.com/how-to-make-her-horny">Horny</a>
<br />


MAC DARA

Posted on : April 15, 2018

I am glad that my friend suggested me <a href="http://essayshop.biz/">http://essayshop.biz/</a>
to do research. They information they post is very authentic and easily
understandable. I would further suggest it to my other friends.<br />


Post a Comment

Categories
Tags

Useful Microsoft Windows 8.1 Tips

http://schemas.google.com/blogger/2008/kind#post

"The value you enetered is not valid. A user has restricted values that can be entered into this cell"

Build an Applications folder for quick program launching from the Start screen or Desktop in Windows 8

"God Mode" in Windows 8

Log in without a username or password in Windows 8

Running two apps side by side in Windows 8

Android Support

Apple Support

VMware ESX and ESXi 4.0 Comparison

Open multiple user mailboxes in OWA 2010

Attach Picture in Body of mail in OWA or Webmail

How to use Windows Notepad as a Diary:

Keyboard Shortcuts

Outlook 2013

Set pop-out as default while replying

Disable / Enable the typing animation in Outlook 2013

Windows 8 Sync Apps

Enterprise Unified Communications Comparison Chart

Installing and troubleshooting problems for Windows Phone

Tutorials Site

How to Use the BCDEDIT

Windows 7 Start-up Process:

Error while doing Software Update on Windows Phone

Paste Special option missing in any office 2010 application’s.

starting Rs. 16

Tech News - Google Nexus 7 tablet available online in India

952 | Techgig

Missing Mail Recipient entry from Send To Menu

How to Test Outlook Connection and Auto Configuration

Difference between Windows Server 2008 and Windows Server 2008 R2

Features of Windows Server 8 :

How to Reset Local Group Policy Objects to default

Windows 8 Shortcut keys

Change local admin password from command prompt (Hack)

Error C0000034 While installing SP1 for windows 7

Outlook Hangs at loading profile

Outlook Stuck in Task Bar (Opens off the screen/minimized)

How to Recover Deleted Emails in Outlook

http://comtechsolution.blogspot.com