Remove password for Outlook VBA Project - vba

I password protected an Outlook VBAProject and then subsequently forgot the password. Luckily, I exported the VBA code, but I'd like to unprotect the VBAProject.otm file.
I saw online how to do this for Excel projects, but not for Outlook VBA. Any ideas? Tks!

Try using VBA Password Recovery Master.
Also see Download VBA Password Recovery Free Software- Get VBA Password Again!.

Try using the Hex Editor option. Open the OTM file in Hex Editor and try changing the DPB to DPx and save the file and then try opening the vba in outlook.
Note: use the above by creating a copy of OTM file ot it might get corrupted.

Related

Getting to VBA in password protected

I've been tasked with updating a .xlsm file with VBA that is accessed via the Citrix Workspace application. The previous author has left the company and did not leave behind any further documentation on it.
The VBA is password protected. I've broken and readjusted VBA passwords with a hex editor before, and would gladly try that. Only thing is that the author of this current project also threw in some VBA which prevents the file from being saved as which is then password protected.
Any idea of how I can get through the save prevention VBA? Or perhaps get the file saved as a .zip to my computer?
SOLVED! Despite me flipping "disable macros" and ActiveX components I was still being prevented from saving the file. What I did, however, was navigate to the file's location, did a right click copy, and then just pasted it to the desktop. From there I was able to adjust the file extension to a .zip, and then cracked the password protection via the Hex editor method.

How do I create a .vba file?

I need to save a file as a .vba on my windows computer, but have no idea how to go about it. Can anyone help?
I
You should save your file as ".xlsm"
Don t you mean VBS? cos vba is not a file extension.. vba = vb for applications, you need to specify which office app? outlook, excel, access?
You can open the file through excel application and save as ".xlsm" extension.
It can either be saved as an .xlsm file, or you can copy the code to Notepad or editor and save it as a text file for convenient storage. The "xlsm" means "macro- enabled workbook"

How to crack the password for VBA modules in excel 2010

I have an excel 2010 macro enabled workbook for which I have forgotten the password. I tried the method of chaging the file extension to zip and then using the hex editor to change "DPB" to DPx". However when I reopen the xlsm file then excel will repair the workbook and the VBA modules are gone from the file.
Please suggest a way to crack the VBA module password. I used one of the method as per the below link :
Is there a way to crack the password on an Excel VBA Project?
Just open your excel file with a libre office!!(you can download it for free:
https://www.libreoffice.org/)
I have tried many times and works fine, open the modules without ask you for a password!!
Copy them and create a new file!!

How to Make a VBA Excel Program Work on Other Excel Documents?

I'm very new with VBA Excel and i only know the things as far as i need for this report formatting task. My code is almost completed, but what i wonder is, how can i make my program work on several documents?
I mean, i want to choose an excel file via my program, then i want to start the process of report formatting. Then maybe user need to format another document, i want my program to be able to format that document too. how can i achieve that?
Thanks in Advance
Timur
The way I am currently doing this is by creating an Excel add-in. To do this, place your macros and forms into a new, empty Excel workbook and save as a .xlam document.
To use the macros, open the your Excel file and the add-in. To open the add-in automatically, save it to "C:\Program Files\Microsoft Office\Office12\XLSTART" (Vista).
You can even create a custom ribbon for your add-in using the Custom UI Editor for Microsoft Office http://msdn.microsoft.com/en-us/library/office/ee691832(v=office.14).aspx (The download link is at the end of the instructions)

Removing the password from a VBA project

How can I programmatically remove a (known) password from an Excel VBA project?
To be clear: I want to remove the password from the VBA Project, not the workbook or any worksheets.
Another way to remove VBA project password is;
Open xls file with a hex editor.
(ie. Hex Edit http://www.hexedit.com/)
Search for DPB
Replace DPB to DPx
Save file.
Open file in Excel.
Click "Yes" if you get any message box.
Set new password from VBA Project Properties.
Close and open again file, then type your new password to unprotect.
UPDATE: For Excel 2010 (Works for MS Office Pro Plus 2010 [14.0.6023.1000 64bit]),
Open the XLSX file with 7zip
If workbook is protected:
Browse the folder xl
If the workbook is protected, right click workbook.xml and select Edit
Find the portion <workbookProtection workbookPassword="XXXX" lockStructure="1"/> (XXXX is your encrypted password)
Remove XXXX part. (ie. <workbookProtection workbookPassword="" lockStructure="1"/>)
Save the file.
When 7zip asks you to update the archive, say Yes.
Close 7zip and re-open your XLSX.
Click Protect Workbook on Review tab.
Optional: Save your file.
If worksheets are protected:
Browse to xl/worksheets/ folder.
Right click the Sheet1.xml, sheet2.xml, etc and select Edit.
Find the portion <sheetProtection password="XXXX" sheet="1" objects="1" scenarios="1" />
Remove the encrypted password (ie. <sheetProtection password="" sheet="1" objects="1" scenarios="1" />)
Save the file.
When 7zip asks you to update the archive, say Yes.
Close 7zip and re-open your XLSX.
Click Unprotect Sheet on Review tab.
Optional: Save your file.
I found another way to solve this one to avoid password of VBA Project, without losing password.
If the file type is XLSM files:
Rename the .xlsm as .zip (or you can open the .xlsm with 7zip/WinRAR) and open/extract it
Edit the xl/vbaProject.bin file with Notepad++ or HexEdit
Search for DPB= and replace it with DPx=
Save the file
Copy this file back into the .zip (or zip the files back up)
Rename the archive back to .xlsm
Open the file in Excel, if prompted to "Continue Loading Project", click Yes. If prompted with errors, click OK. Note: the code may still be blank or corrupted, which we fix in the next step
Save the file as a new .xlsm file
Open the new file in Excel (should be no errors now)
Press Alt+ F11 to open the VBA editor
or
Follow this Step Also
I found another way to solve this one to avoid password of VBA Project, without losing excel password.
use Hex-editor XVI32 for the process
if the file type is XLSM files:
Open the XLSM file with 7-Zip (right click -> 7-Zip -> Open archive). 2. Copy the xl/vbaProject.bin file out of the file (you can drag and drop from 7-Zip), don't close 7-Zip
Open the vbaProject.bin file with HexEdit
Search for "DPB=" and replace it with "DPx="
Save the file
Copy this file back into 7-Zip (again, drag and drop works)
Open the XLSX file in Excel, if prompted to "Continue Loading Project", click Yes. If prompted with errors, click OK. 8. Press Alt+ F11 to open the VBA editor.
While press it will show error “Unexpected error (40230)”, just click OK (6 or 7 times) until it goes away.
Then it will open Automatically
This has a simple method using SendKeys to unprotect the VBA project. This would get you into the project, so you'd have to continue on using SendKeys to figure out a way to remove the password protection:
http://www.pcreview.co.uk/forums/thread-989191.php
And here's one that uses a more advanced, somewhat more reliable method for unprotecting. Again, it will only unlock the VB project for you.
http://www.ozgrid.com/forum/showthread.php?t=13006&page=2
I haven't tried either method, but this may save you some time if it's what you need to do...
My 2 cents on Excel 2016:
open the xls file with Notepad++
Search for DPB= and replace it with DPx=
Save the file
Open the file, open the VB Editor, open modules will not work (error 40230)
Save the file as xlsm
It works
I found this here that describes how to set the VBA Project Password. You should be able to modify it to unset the VBA Project Password.
This one does not use SendKeys.
Let me know if this helps!
JFV
After opening xlsm file with 7 zip, extracting vbaproject.bin and in Notepad ++ replacing DpB with DPx and re-saving I got a Lot of vbaproject errors and vba project password was gone but no code/forms.
I right clicked to export and was able to re-import to a new project.