Remove Vba Password From Xlsm File

7 views
Skip to first unread message

Patricia

unread,
Aug 5, 2024, 8:14:02 AM8/5/24
to aculavstar
Yesthere is, as long as you are using a .xls format spreadsheet (the default for Excel up to 2003). For Excel 2007 onwards, the default is .xlsx, which is a fairly secure format, and this method will not work.

DISCLAIMER This worked for me and I have documented it here in the hope it will help someone out. I have not fully tested it. Please be sure to save all open files before proceeding with this option.


*NOTE: Be sure that you have changed the password to a new value, otherwise the next time you open the spreadsheet Excel will report errors (Unexpected Error), then when you access the list of VBA modules you will now see the names of the source modules but receive another error when trying to open forms/code/etc. To remedy this, go back to the VBA Project Properties and set the password to a new value. Save and re-open the Excel document and you should be good to go!


With my turn, this is built upon kaybee99's excellent answer which is built upon Đức Thanh Nguyễn's fantastic answer to allow this method to work with both 32/64 bit versions of Office.


Colin Pickard has an excellent answer, but there is one 'watch out' with this. There are instances (I haven't figured out the cause yet) where the total length of the "CMG=........GC=...." entry in the file is different from one excel file to the next. In some cases, this entry will be 137 bytes, and in others it will be 143 bytes. The 137 byte length is the odd one, and if this happens when you create your file with the '1234' password, just create another file, and it should jump to the 143 byte length.


This is not valid for Excel 2007/2010 files. The standard .xlsx file format is actually a .zip file containing numerous sub-folders with the formatting, layout, content, etc, stored as xml data. For an unprotected Excel 2007 file, you can just change the .xlsx extension to .zip, then open the zip file and look through all the xml data. It's very straightforward.


However, when you password protect an Excel 2007 file, the entire .zip (.xlsx) file is actually encrypted using RSA encryption. It is no longer possible to change the extension to .zip and browse the file contents.


It's simply a matter of changing the filename extension to .ZIP, unzipping the file, and using any basic Hex Editor (like XVI32) to "break" the existing password, which "confuses" Office so it prompts for a new password next time the file is opened.


Microsoft Office VBA Project passwords are not to be relied upon for security of any sensitive information. If security is important, use third-party encryption software.


In the event that your block of CMG="XXXX"\r\nDPB="XXXXX"\r\nGC="XXXXXX"in your 'known password' file is shorter than the existing block in the 'unknown password' file, pad your hex strings with trailing zeros to reach the correct length.


For Excel 2007 onward you need to change your file extension to .zipIn the archive there is a subfolder xl, in there you will find vbaProject.bin.Follow the step above with vbaProject.bin then save it back in the archive.Modify back your extension and voil! (meaning follow steps above)


Colin Pickard is mostly correct, but don't confuse the "password to open" protection for the entire file with the VBA password protection, which is completely different from the former and is the same for Office 2003 and 2007 (for Office 2007, rename the file to .zip and look for the vbaProject.bin inside the zip). And that technically the correct way to edit the file is to use a OLE compound document viewer like CFX to open up the correct stream. Of course, if you are just replacing bytes, the plain old binary editor may work.


If the file is a valid zip file (the first few bytes are 50 4B -- used in formats like .xlsm), then unzip the file and look for the subfile xl/vbaProject.bin. This is a CFB file just like the .xls files. Follow the instructions for the XLS format (applied to the subfile) and then just zip the contents.


Tom - I made a schoolboy error initially as I didn't watch the byte size and instead I copied and pasted from the "CMG" set up to the subsequent entry. This was two different text sizes between the two files, though, and I lost the VBA project just as Stewbob warned.


Using HxD, there is a counter tracking how much file you're selecting. Copy starting from CMG until the counter reads 8F (hex for 143) and likewise when pasting into the locked file - I ended up with twice the number of "..." at the end of the paste, which looked odd somehow and felt almost unnatural, but it worked.


I don't know if it is crucial, but I made sure I shut both the hex editor and excel down before reopening the file in Excel. I then had to go through the menus to open the VB Editor, into VBProject Properties and entered in the 'new' password to unlock the code.


ElcomSoft makes Advanced Office Password Breaker and Advanced Office Password Recovery products which may apply to this case, as long as the document was created in Office 2007 or prior.


The protection is a simple text comparison in Excel.Load Excel in your favourite debugger (Ollydbg being my tool of choice), find the code that does the comparison and fix it to always return true, this should let you access the macros.


The truth is that the code files for most macro-enabled Office documents are not encrypted and the password only prevents opening the project with Office programs.This means that, as other answers suggested, you can usually use an Office alternative to access and edit the file.


However, if you just need access to the code, you can use a tool like oledump.py to extract the Macro code. This is useful for malware analysis, as well as getting most of the code from the file so that you don't have to start from scratch if you forget the password.


For Excel 2016 64-bit on a Windows 10 machine, I have used a hex editor to be able to change the password of a protected xla (have not tested this for any other extensions).Tip: create a backup before you do this.


If you are also in a similar situation where you forgot your VBA password in an Excel file and want to remove/reset the password, then this write-up is for you. Here, you will get a manual that will help you remove Excel VBA password using Hex Editor and an automated tool that will help you reset your VBA password in just a few clicks.


These are the free steps to remove VBA password from Excel file. You can easily remove the password protection from your VBA project using these procedures. However, there might be some users who might find this process a bit complex.


SysTools VBA Password Remover Software is an effective solution that permits users to reset passwords from single or multiple VBA documents at once. It is capable enough to crack multilingual passwords from Word, Excel, and Access files including .doc, .docm, .dot, .dotm, .xls, .xlsm, .xlt, .xltm, .xlsb, .xla, .xlam, .mdb, .accdb, .pptm, .potm, .ppsm.


The software has a user-friendly interface which makes it easier for even non-technical users to operate it. Furthermore, this efficient program is functional with all the below and prior versions of Windows OS and Microsoft Office (32/64 bit).


This how-to guide well explained the efficacious methods to remove VBA Password from Excel files. However, we recommend you go with the professional tool to crack multilingual VBA passwords from Excel files. Users can also avail themselves of the free demo edition of the utility for evaluation purposes without investing a single penny.


I usually don't deal with VBA (thank goodness) - but I have been asked on several occasions to remove a VBA password from an excel workbook. In the instances that I did (remove the password) it was not for nefarious purposes, but because someone had either forgotten the password or had a file they were now responsible for and the previous user had (who set the password) had left the company.


Hi All,

I have a password protected Excel with .xlsm Format I have the password too, But I want to remove the password for the same excels I Have installed Bala Reva packages also but unable to find the Set Password Activity, Any other way to do so.

Make sure the excel which we get after removing password will be macro enabled.

Thanks in advance


Are you also finding a reliable and trustworthy method to remove password from Excel VBA code? If your answer is yes to all these types of questions then, you are landed on the right webpage. Here, in the following section, we are going to cover all these points within a few simple steps.


System administrators and working professionals protect their Excel VBA projects with a complex password. But sometimes they forget the exact password and then start searching for a solution to erase Excel VBA project password. Sometimes this task becomes unavoidable due to editing, modifying, debugging, and reusing VBA programming code scripts.


VBA stands for Visual Basics for Applications which is a part of Microsoft Office. It is used in various applications such as Microsoft Word, Excel, PowerPoint, Access, and all others. This is a programming script code, that is used to add automation functionality in MS Office. This is why the users kept these Visual Basic Application files protected by using a strong password. However, no doubt the passwords are very helpful in safeguarding the files. But there is always a possibility that you lost or forgot the password.


While performing the above-mentioned manual solution, users need to be more cautious as even a single wrong step may create a problematic situation for them. Therefore, alternatively, a user can use an automated solution, i.e., the VBA Password Recovery Tool.


This is a modern tool designed by professionals to remove Excel VBA project password in a quick manner. It can remove and reset multilingual VBA project password also. The users need to follow a few simple steps to execute this task easily, as mentioned below:

3a8082e126
Reply all
Reply to author
Forward
0 new messages