• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

About VBA Project Password [SOLVED]

sgmpatnaik

Active Member
Hello Ninja's


Good Morning


I got one problem that is i created one file in 1 year back as Macro Enabled Workbook (.xlsm) and i gave a VB Project password for that file, in that file i used lot of macros and Formulas now i want to view that file but i can't remember the password what i gave.


I tried with Hex Editor but i can't get the DPB name in that file because it is not a .xls and i can't Save As the file because in the workbook module i gave this code

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If SaveAsUI = True Then
MsgBox "Sorry - You may not use the ""Save As ..."" command with this workbook", _
vbExclamation, "Operation not permitted"
Cancel = True
End If

End Sub

I disable the macro and try to Save As but i can't


so i came here to get some solution from you


Thanks


SP
 
Last edited by a moderator:
I used a hex editor hack on an xlsx file last month and it worked fine. Can't remember the specifics, and it's possible it's against protocol to put specifics here anyway. But google is your friend...
 
@jeffreyweir


Hi


Thanks for your quick response i tried with google search but i didn't get the correct result for that type of file


i found all this type of result that is


save as the file to .xls and find DPB and replace with DPx


But in my file i never find the DPB option due to it is .xlsm file and i can't save as the file also


any comments please


Thanks


SP
 
Dear sgmpatnaik


Please send the file on my email id i will try to get that password


vijaykumar@yamaha-motor-india.com
 
@Vijay


Hi


Thanks for your replay i can't send that file because that is our office personal file. so if you know the procedure then please tell me i will my best and also it is full for others also who will face the same problem in future.


any how i will give one normal file with same facilities let's try


https://dl.dropboxusercontent.com/u/75654703/For_Vijay.xlsm


Thanks


SP


Edit: File send to your id too
 
Last edited by a moderator:
Dear sgmpatnaik


I can't tell you the process, becoz i have a tool to remove/recover the password. If you wish to know the password of your original file, then u have to sent it.


I will keep your privacy.


Regards

vijay
 
Hi, sgmpatnaik!


Give a look at this file:

https://dl.dropboxusercontent.com/u... Password (for sgmpatnaik at chandoo.org).rar


I did this:

1) Created a new workbook, in 1st sheet put 123, 1234, 13245, 123456 in A1:A4.

2) Added a new module and place this code:

-----

Code:
Option Explicit
 
Sub X()
MsgBox "hello, world!"
End Sub
-----

3) Saved the workbook as Libro1.xlsm.

4) Set VBA project password to 1234 and saved the workbook as Libro2.xlsm.

5) Copy both files from *.xlsm to *.zip.

6) Extracted both .zip files into folders Libro1 & Libro2 which each has this internal file structure:

Protected VBA Project 01.png

7) Run WinDiff on both folders and got two differences:

Protected VBA Project 02.png

1st (.docpropscore.xml) just because of the saved date time stamp, and 2nd (.xlvbaproject.bin) as the password protection difference.

8) Double clicked on 2nd difference and got this:

Protected VBA Project 03.png

where you have uncolored the lines that are equal, yellowed those of file 1 (unprotected) and reddish those of file 2 (protected)... and greened into the ellipse the VBA code, in this case common to both of them.

9) Opened again Libro2.xlsm with Excel and saved it as Libro0.xlsx without macros.

10) Copied Libro0.xlsx as Libro0.zip

11) Unzipped Libro0.zip to folder Libro0

12) Checked that the only "file" difference was the absence of vbaProject.bin.

13) Copied Libro2 folder as Libro3.

14) Deleted vbaProject.bin from folder Libro3xl.

15) Zipped Libro3 folder as Libro3.zip.

16) Renamed Libro3.zip to Libro3.xlsx and didn't worked.

17) Renamed Libro3.zip to Libro3.xlsm and didn't worked.

18) Zipped whole work folder and uploaded it (the previous link).


So you could do this:

a) Create a work folder.

b) Create an new Excel file.

c) Save it as .xlsm.

d) Copy this new file and your original one to that folder.

e) Open the original one and save it as .xlsx without macros.

f) Rename both .xlsm to .zip.

g) Extract each .zip into a new subfolder.

h) Run WinDiff on these folders.

i) Discard all other differences and find .xlvbaproject.bin one.

j) Double click on it.

k) Now search for the code which should be all in red as there were no code in 1st file.

l) Copy, extract, steal, do something, and paste it into a text editor, and patiently clean the code from embedded control characters.

m) Open the .xlsx file.

n) Insert a new module.

o) Copy and paste the easily and painlessly retrieved code into it.

p) Save the workbook as .xlsm with a new name (don't overwrite the original)

q) Don't do that again or buy ElcomSoft Advanced Office Password Recovery Standard Edition (not Home) and send me a copy.

http://www.elcomsoft.com/aopr.html

r) Rectify q), if you're gonna send me a copy better buy the Professional Edition :)


Regards!
 
@vijay.vizzu

Hi!

Check this:

http://support.microsoft.com/kb/159214

http://en.wikipedia.org/wiki/WinDiff

It's a standard program that comes with all Windows versions since I have memory, in a machine running Win7 x64 it's placed here:

"C:Program Files (x86)Microsoft SDKsWindowsv7.0ABinx64WinDiff.Exe"

To find it (or to discover that you don't have it) just press the Start Button and type WinDiff. (If someone stole you the Start Button -aka you're using Win8- send a mail with the complaints to Redmond guys, even they're planning to reinstall it with Win8 SP1 later this year, but a preview version is available for download).

If you don't have it try installing all Windows features and then retry.

Regards!


@smgpatnaik

Hi!

Glad to help you, but did you solved it?

I wouldn't like too much to have to keep on playing with xlsm, zip, folders and binaries... Serious things like NFS The Run & ChessMaster 11 are still waiting for me, and non serious things like OllyDbg 2.01 and Backtrack 5 are queued too :p

Regards!
 
Last edited by a moderator:
Dear Sirjb7


In my system, it is not appearing, how can i get this.


ms office info:

office 2010, 32 bit


windows 7 Professional SP1, system type 64bit


Regards

Vijay
 
Hi, vijay.vizzu!

I don't exactly know how I always get it installed in all my own and third-party installations. Have you followed my previous suggestion of "If you don't have it try installing all Windows features and then retry."?

Regards!
 
@SirJB7


Hello sir


yes i solved my problem, facing with little bit problems


Thanks for your guideline


Happy weekend


Cheers


SP
 
Back
Top