0% found this document useful (0 votes)
478 views

Remove An Excel VBA Password With A HEX Editor - DavidBugden

The document describes how to remove an Excel VBA password by editing the workbook file with a hex editor. It involves opening the file in a hex editor, searching for the text 'DPB' and changing it to 'DPx', saving the file, and then setting a new password in Excel to remove the protection.

Uploaded by

manoj444_777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
478 views

Remove An Excel VBA Password With A HEX Editor - DavidBugden

The document describes how to remove an Excel VBA password by editing the workbook file with a hex editor. It involves opening the file in a hex editor, searching for the text 'DPB' and changing it to 'DPx', saving the file, and then setting a new password in Excel to remove the protection.

Uploaded by

manoj444_777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

DavidBugden.com
Inconsistentlyinconsistent
Home
About
Typetexttosearchhere...

Home>Excel,Geek>RemovinganExcelVBApasswordusingaHexeditor

RemovinganExcelVBApasswordusingaHexeditor
March6th,2008adminLeaveacommentGotocomments
AVBAprojectpasswordcanberemovedwithahexeditor(IusedtheXVI32Freewareeditorfromhere).AlthoughIdidntdiscoverthis
method,Imhappytoposttheprocesswithscreenshotstohelpothers.Sometimesallweneedisthatlittlesnippetofcodeinanold
VBAprojectwevearchivedaway
Openyourchosenworkbookfile(.xlsor.xlafile)inthehexeditor.Itwilllooklikethefollowing

TheXVI32Hexeditor
NowsearchfortheTextstringDPBandchangeittoDPx(simplytypeoverthevalue).

Searchfortextstring"DPB"

http://davidbugden.com/?p=16&ckattempt=1

1/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

Completedsearch

ChangefromDPBtoDPx
Savethefileoverthetopoftheexistingworkbookandclose.

Saveprotectionsettings
Now,opentheworkbookinExcelandclickOKuntiltheworkbookisopen(youmayreceiveacoupleofVBAerrorsontheway).Press
ALT+F11toopentheVisualBasicProjectwindow,FromtheToolsmenu,choosethecommandVBAProjectProperties,navigatetothe
Protectiontab,andchangethepasswordbutdonotremoveit(notethenewpassword).
Savetheworkbook,close,andreopen.
Onceopen,pressALT+F11andenterthenewpassword.
Finally,chooseTools>VBAProjectProperties,navigatetotheProtectiontab,andremovethepassword.
Savetheworkbook.

http://davidbugden.com/?p=16&ckattempt=1

2/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

Categories:Excel,GeekTags:excelpasswordhex,excelvbapassword,freevbapasswordremoval,Geek,vba
excelpasswordremove,vbapassword,vbapasswordhex,vbapasswordremovalhex
Comments(48)Trackbacks(0)LeaveacommentTrackback
1.
Patnaik
July6th,2013at14:35|#1
Reply|Quote
HelloAdmin
Stillwaitingforyourresponse
reallyappreciateonyourhelp
Thanks
Patnaik
2.
Ajay
July8th,2013at16:28|#2
Reply|Quote
Thanksalotitworks.YoucandownloadHexeditorfrom:http://www.hhdsoftware.com/Downloads/free
hexeditor
3.
AddInMacros?
July17th,2013at04:37|#3
Reply|Quote
Ihavedifferenttypeofissue:ThereisanExceladdininstalledwhichisamacro.SothereisnoXLS
sheetpersebuteverysheetIopenIcanseethismacro(xxxx.XLA).AnywayIcaneditthisone?Thanks
inadvance!
4.
Gordo
August14th,2013at00:10|#4
Reply|Quote
Tocracka2007/2010ExcelVBApassword:
1.Change.xlsmextensionto.zip
2.Openthezippedfolderandnavigateintothexlfolder
3.ExtractthevbaProject.binfileandopenitinaHexEditor
4.SearchforDPBandreplacewithDPx
5.ReplacetheoldvbaProjectfilewiththisnewoninthezipfolder(andrezip)
6.Changethefileextensionbackto.xlsm
7.Openworkbookandignoreallwarningmessages
8.Exportthecodemodulesandthenreaddthem(deletetheoldones)
http://davidbugden.com/?p=16&ckattempt=1

3/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

5.
Dawn
August30th,2013at21:57|#5
Reply|Quote
Gordo:
Tocracka2007/2010ExcelVBApassword:
1.Change.xlsmextensionto.zip
2.
3.
Steps47
8.Exportthecodemodulesandthenreaddthem(deletetheoldones)
Gordo,theveryclearinstructionsofyourposthavesavedme!IinheritedaclientsVBAProjectwith
passwordprotection,theoriginalownerlonggone.IfiguredIwasgoingtotrytocompletelyrewriteall
modulesintheProjectbasedonwhatIcouldseehappeningwhenthemacroswererun.Thiswouldhave
beenacompletenightmareasIdbeguessingonalotofthefunctionality.Thankstotheoriginalposted
article(March2008)andyourrecentcommentwithsimpleinstructions,Iamabletoexportallthe.bas
and.clsfileswithoutfussforfreshimporttoacleanProject.
THANKS!
6.
Bielan
September1st,2013at21:47|#6
Reply|Quote
Muitobomman,conseguifazerfilnooffice2010emcasa,masno2007lanaempresadeuproblema,
noseisefaltavaalgumabiblioteca(creioqsim),maseleexcluiaomdulodovbaeficavasomenteas
Sheetsnormaissemcdigo.mdulos,classeseformsnoapareciam.
7.
Steve
September5th,2013at10:54|#7
Reply|Quote
a)PeoplewhosaytheycantfindDPB:FilemustbeXLS(notXLA,notXLT).Alternateprocessfor
thenewerxformatsrequiresunzippingfirst,andeditingtheVBAProject.binfile.
b)CheckyouractuallysavingthechangesmyHexEditordidntsavenormally,soitwasfailing
becauseIwasntactuallysaving.BoyIfeltdumb.
c)Ignoretheunforseenerrormessage:thishacktellsXLtoallowyoutosetanewpassword.
WhenyouopenthefileyouhavetoSETANEWPASSWORDwhichyoucanthenremoveifyoulike.
Thefileisbrokenuntilyousetanewpasswordandsavethenthestupiderrorsgoaway.
8.
Dylan
September12th,2013at04:51|#8
Reply|Quote
ThanksalotGordon,itworked!
http://davidbugden.com/?p=16&ckattempt=1

4/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

9.
Surya
October16th,2013at03:51|#9
Reply|Quote
ThanksaTon!!!!Iamshortofwordsforhelpingmetorecoveralongforgottenxlapassword
10.
thiru
October18th,2013at20:01|#10
Reply|Quote
DPBisnotfoundinmyexcelfile,whattodonow??
11.
akmal
October18th,2013at20:31|#11
Reply|Quote
Thatsolvedmyproblem.withinlessminuteitsworkedgreatwithexcel2003and2007.thanksman.
12.
thiru
October18th,2013at23:11|#12
Reply|Quote
iwentthroughyourpreviousereplyonthesameissue,butiamnotabletofindtheDPBevenafteri
sangingthefilenameto.XLS.
13.
Bernardo
November26th,2013at02:55|#13
Reply|Quote
Hello.Ihavesomefiles(oldfilesfrom2000).Someofthenare.XLAandoneis.XLL.Iwouldliketo
useitonExcel2010/2013.ButVBAprojectsdisappearswhenIaddinthosexla.Thatsmyfirstproblem.
Thesecond,howIopenthefile.XLLeseewhatiswritteninside?Isitpossible,savetheXLLasXLAM?
tksalotpeople
14.
admin
November26th,2013at08:08|#14
Reply|Quote
ThisisabrilliantsolutionGordo,greatwork.Illpostupanewentrywithsomescreenshotsinthenear
future.GoodtoseetherearestillwaysaroundVBAprojectprotection!

http://davidbugden.com/?p=16&ckattempt=1

5/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

15.
Kelvin
December11th,2013at09:03|#15
Reply|Quote
IjustwentthroughtheprocessofextractingandeditingtheVBA.binfile.Thexlsmfilewillnotopenin
excelafterthechangebecauseitiscorrupt.anysuggestions?
16.
u
December12th,2013at08:26|#16
Reply|Quote
Hi,Iamgettingthesameerroraswell.canyoupleasecheck.
erroris.Theexcelcannotopenxlsmbecausethefileformatorfileextensionisnotvalid.Verifythatfile
hasnotbeencorruptedandthatthefileextensionmatchestheformatofthefile.
thanks.
17.
Edwin
January9th,2014at04:16|#17
Reply|Quote
Justunzippingandrezippinganxlsmfilecorruptsthefile(evenifnochangesaredoneinthefiles).
Imusing7zip.Ideas?
18.
Adam
January23rd,2014at11:43|#18
Reply|Quote
Changeto*.rar.It`sworks
19.
Larry
February1st,2014at06:27|#19
Reply|Quote
ThesameproblemdescribedabovebyKelvinoccurredinmycaseaswell.Anyideas?
20.
Patrick
February12th,2014at13:27|#20
Reply|Quote

http://davidbugden.com/?p=16&ckattempt=1

6/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

Hianotherconfirmationthatthisworksjustdontforgettosavethebinfilebacktoitsoriginal
directorybeforerezippingmanythanks!!
21.
Rob
February26th,2014at06:24|#21
Reply|Quote
WhatworkedformeisafterchangingtheVBA.binfileandplacingbackinthezipfile,Irenamedthezip
fileto.xls,not.xlsm,andopeneditfromthere.Gottheerrorstoclickthrough,thenopenedtheVBeditor,
enteredanewpw,savedthefileas.xlsm,openedagain,andthereallthecodewas.FromthereItookthe
pwoffandsaved.NowIcangetinthecodewithnoproblem.
22.
Mynewlifex
March18th,2014at05:49|#22
Reply|Quote
Notwrokedformestillgivemefilecorrupted,anyadvice,ichangedtheHEXeditortwisestillgotthe
sameproblemuseXLSinsteadofXlsmsameproblem,howcanovercomethecorruption.
23.
Putri
March20th,2014at15:25|#23
Reply|Quote
Thanksalot,itworks
24.
Ranjit
April7th,2014at03:37|#24
Reply|Quote
@Ajay
HiAjay,
CouldyoupleasehelpmetobreakVBAcodepassword..orexplainmethestepshowtodo.AswhenI
openthefileinhexeditorandsearchforDBPstringitdoesntfoundanymatch..
Regards
RS
25.
PP
April23rd,2014at21:58|#25
Reply|Quote
Hello,

http://davidbugden.com/?p=16&ckattempt=1

7/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

Whatdoyoumeanby:
Exportthecodemodulesandthenreaddthem(deletetheoldones)
HowdoIdothat?
Regards,
P.
26.
Abraham
August20th,2014at02:12|#26
Reply|Quote
Ididallthestepssuccessfullybutnotreceiveerrormessageswhileopenexcelfile,andthepasswordis
stillthere ImusingExcel2010
BestRegards.
27.
AnthonyGentle
August22nd,2014at06:52|#27
Reply|Quote
Ihaveapasswordprotectedxlammacrofilethatspasswordprotected.Justwantedtomentiontoany
futurereaderswhomayhavegottenslightlyconfused,thisiswhatIdidanditworkedperfectly:
1.copiedthe.xlamtomydesktop
2.changed.xlamto.zip
3.madeacopyofthezipfile(calledname_copy)
4.extractedname_copy.zip
5.inahexeditor,editedDPBtoDPxtwiceinthevbaProject.binfile
6.intheoriginalzipfile(whichwasneverextracted,replacedthevbaProject.binfilewiththeeditedone
fromthecopiedzipfolder
7.renamedtheoriginalzipfilebackto.xlam
8.openedthexlamandclickedYestoabout1520messages,thenwentintodeveloper>VisualBasic,
andcannowseeallthemodules!
BasicallyitsGordosstepsandidea,justbrokenoutintoslightlymoredetail,incaseanyoneelseislike
meandneedsitallspelledout.Allthesestepsmaynotberequired,butwhenIextractedtheoriginalzip
fileandeditedthebinthenrezippedit,thatdidntwork,soIthinkneverextractingtheoriginalzip,but
insteadmakingacopyofitthenextractingandeditingthecopy,ithelpspreventthatissue.
Thanksforthisposteveryone!certainlysavedmyday!
28.
Mayank
September16th,2014at19:09|#28
Reply|Quote
hellothere!
Ihaveaexcelfile(.xlsx)whereiputinastrongpasswordtoOPENandnowforgotit.
isthereanywayyoucanhelpmetoopenit?
http://davidbugden.com/?p=16&ckattempt=1

8/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

bestregards
29.
Mayank
September16th,2014at19:11|#29
Reply|Quote
forgottomentionitsexcel2007
30.
sohail
November12th,2014at03:33|#30
Reply|Quote
Hi,
MIneisaXLSfile,howveriamunabletofindDPBwhenfindin.Ipressctl+fforfind.
howcanisenduaprintscreentoshowthis.itriedallthewayicould.
31.
AJC
November19th,2014at10:17|#31
Reply|Quote
IvefoundDPBandchangedtoDPx.Saved.ThensenttoZIPandthenchagedextensiontoxlsm.When
tryingtoopenitgivesmeamessageofcorrupetedandthenasecondboxsayingitscorruptedandcant
opentheefile.Helpplease
32.
Cody
January27th,2015at13:30|#32
Reply|Quote
ThisaddinseemstoquicklyremovetheprotectionofVBAprojectswithoutneedingtogobehindthe
scenesandmesswiththesourcecode.Mightbeasimplersolutionforthoseofuswhoarenotastechnical
http://www.thespreadsheetguru.com/passwordrecovery
33.
michael
February10th,2015at17:54|#33
Reply|Quote
@AnthonyGentle
Ihavegotapasswordprotectedxlammacrofile.Justwantedtomentiontoanyfuturereaders,Ididallthe
mentionedstepsanditworkedperfectly.
Instep5IeditedDPBtoDPxonlyonceinthevbaProject.binfile.NosecondDPBwasfound.
WhileopeningthexlamIclickedYes/OKtoseveralmessages,thenwentintodeveloperVBandcannow
seeallthemodules!
http://davidbugden.com/?p=16&ckattempt=1

9/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

bestregards
34.
Venk
March29th,2015at18:45|#34
Reply|Quote
@Mayank
HiMayank,Idonhavethesameissue.Didyougetanyworkaround?
35.
Vin
March31st,2015at22:31|#35
Reply|Quote
@Gordo
ThanksGordo,workedperfectly!
36.
Steve94928
April29th,2015at04:39|#36
Reply|Quote
Thisisgreat.Thankyoualot,itworksbeautifully.Itsavedmesomuchtimeandwork.
37.
RC3
May7th,2015at05:03|#37
Reply|Quote
IamusingExcel2010torecoverthepasswordforanXLSM.
ThisiswhatIhadtodo.Itisacombinationofstepsfromthispost(AnthonyGentle)andfromanother
websitereferencedbelow.
1.copiedthe.xlsm
2.changed.xlsmto.zip
3.madeacopyofthezipfile(calledname_copy)
4.extractedname_copy.zip
5.inahexeditor,editedDPBtoDPx(searchtwiceinanXLAM)inthevbaProject.binfile
6.intheoriginalzipfile(whichwasneverextracted,replacedthevbaProject.binfilewiththeeditedone
fromthecopiedzipfolder
6b.IhadtoopentheuneditedzipfileinwinRARandaddthevbaProject.binfileintotherar/zipfileatthe
originallocation.
7.renamedtheoriginalzipfilebackto.xls
8.openedthe.xlsandclickedYestotheerrormessagesthatcameup
9.Thengointodeveloper>VisualBasic(clickOKorYESonanymessagesthatcomeuphere):
9b.ChooseTools>VBAProjectProperties,navigatetotheProtectiontab,enternewpasswordofyour
choceandthenconfirmitagain(ifyouwantnewpassword).Otherwisesimplyleavethetextboxblank,
removecheckfromlockprojectforviewing,thenSAVEandcloseexcelandreopenit!
(http://stackoverflow.com/questions/16847059/access2007unexpectederror40230)
http://davidbugden.com/?p=16&ckattempt=1

10/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

10.Afterclosingtheworksheetandreopneing,IstillgotanerrorwhenIopenedtheXLSfile,soIsaved
asXLSMandnowIcanseethemodulesandcodeappearstoworkcorrectlystill.
38.
admin
May7th,2015at10:25|#38
Reply|Quote
Thanksforthedetailedsummary,thatsveryhelpful.IthinkitshightimeIupdatedtheposttocaterfor
.XLSMfiles.
Cheers
39.
Vladimir
July1st,2015at01:06|#39
Reply|Quote
Ivegotaslightlydifferentproblem.Thereisa*.xlsmtablewithVBAprojectwhichisprotectedbutdoes
notas?foranypassword.WhenImtryingtoopenthemodule,Isimplygetamessagethattheprojectis
lockedandunviewable,nothingelse.
40.
SAmmy
October16th,2015at22:24|#40
Reply|Quote
Whataboutxlsxfiles?istherethesamewaytofindthepassword?isthereatrick?
41.
rashu
October21st,2015at05:01|#41
Reply|Quote
thanksforthishelpitshelpmealotsthanksverymuchagain..
42.
Hagia
November25th,2015at15:10|#42
Reply|Quote
Thisworkedforme.Thankyousomuchforthehelp.
43.
Hustaon
January29th,2016at01:06|#43
Reply|Quote
Hi,Icannotopenmyfileithaspasswordtoreadit.HowcanIopenit
http://davidbugden.com/?p=16&ckattempt=1

11/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

44.
admin
January29th,2016at08:33|#44
Reply|Quote
Unfortunatelythistechniquecantbeusedonpasswordprotectedfiles.Thatrequiressomebruteforceor
apaidsolution.
45.
Najam
February2nd,2016at22:16|#45
Reply|Quote
CrackSheetProtectionPassword
Thisroutineprovidesapasswordtounprotectyourworksheet.However,itmaynotgiveyoutheoriginal
passwordthatwasused.
Opentheworkbookthathastheprotectedsheetinit.HitAlt+F11toviewtheVisualBasicEditor.Hit
InsertModuleandpastethiscodeintotherighthandcodewindow:
SubPasswordBreaker()
Authorunknownbutsubmittedbybrettdjofhttp://www.expertsexchange.com
DimiAsInteger,jAsInteger,kAsInteger
DimlAsInteger,mAsInteger,nAsInteger
Dimi1AsInteger,i2AsInteger,i3AsInteger
Dimi4AsInteger,i5AsInteger,i6AsInteger
OnErrorResumeNext
Fori=65To66:Forj=65To66:Fork=65To66
Forl=65To66:Form=65To66:Fori1=65To66
Fori2=65To66:Fori3=65To66:Fori4=65To66
Fori5=65To66:Fori6=65To66:Forn=32To126
ActiveSheet.UnprotectChr(i)&Chr(j)&Chr(k)&_
Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_
Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)
IfActiveSheet.ProtectContents=FalseThen
MsgBoxOneusablepasswordis&Chr(i)&Chr(j)&_
Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_
Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)
ActiveWorkbook.Sheets(1).Select
Range(a1).FormulaR1C1=Chr(i)&Chr(j)&_
Chr(k)&Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&_
Chr(i3)&Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)
ExitSub
EndIf
Next:Next:Next:Next:Next:Next
Next:Next:Next:Next:Next:Next
EndSub
46.
http://davidbugden.com/?p=16&ckattempt=1

12/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

ShobhitSharma
February7th,2016at13:37|#46
Reply|Quote
HiihaveanexcelandIforgotpassword,Kindlyguidemewithentireprocess,soicanopenit.
Thanksalot.
47.
Gibus
February29th,2016at13:54|#47
Reply|Quote
Itisagreatideal.Howeverthisisnotagoodchoiceforuserswhodontknowcodingmuch.Hereis
anotherwayoutthatworksinasimpleway:
http://www.iseepassword.com/recovermsexcelpassword.html
hopethishelpswhofinditshardtofollowtheabovetutorial.
48.
Ashishsingh
April26th,2016at23:16|#48
Reply|Quote
thanksalotitsworksformethankyouverymuch.
Commentpages
Previous145616
1.Notrackbacksyet.
Name(required)
EMail(willnotbepublished)(required)
Website

Subscribetocommentsfeed
SubmitComment

Peak&offpeaktorrentschedulingwithTorrent
RSS

http://davidbugden.com/?p=16&ckattempt=1

13/14

8/8/2016

RemoveanExcelVBApasswordwithaHEXeditor|DavidBugden.com

RecentPosts
HowtofixtetheringissuesonTelstrawithanAndroidhandset
RSATforWindows7Extendederror0xc8000222
Peak&offpeaktorrentschedulingwithTorrent
RemovinganExcelVBApasswordusingaHexeditor

TagCloud

Geekutorrentutorrentpeakoffpeakutorrentscheduleutorrentschedulervbaexcel

excelpasswordhexexcelvbapasswordfreevbapasswordremoval

passwordremovevbapasswordvbapasswordhexvbapasswordremovalhex

Categories
Excel
Geek
Uncategorized

Blogroll
DevelopmentBlog
Documentation
Plugins
SuggestIdeas
SupportForum
Themes
WordPressPlanet

Archives
June2013
March2012
May2010
March2008

Meta
Login
TopWordPress
Copyright20082013DavidBugden.com
ThemebyNeoEase.ValidXHTML1.1andCSS3.

http://davidbugden.com/?p=16&ckattempt=1

14/14

You might also like