Unique VBA Password bypassing technology – file modification is not required; Bypasses “Project Locked” – “Project is Unviewable” protection; Applicable to VBA Projects in all VBA-featured documents: MS Office 97 – 2013 (x32 and x64 editions), Visio, FrontPage, AutoCAD (.dvb), WordPerfect, CorelDRAW (.gms), etc. Excel VBA Project Password. If a developer wants to hide the code of the project from the other users, VBA has provided us with a tool to do so, now using this tool we can password protect a single project or multiple projects when we right-click on a project we get an option for VBA project properties and in the protection segment we can password protect the project.
Security Tip: Learn How To Protect Your Code
VBA code stored in worksheets (document modules) can be read from workbooks with unprotected structure (Review > Protect Workbook), even if the VBA project is password locked or unviewable. This hack can be demonstrated with the following simple steps:![Project Project](/uploads/1/2/9/3/129321306/891273292.png)
- Store event code in a worksheet
- Lock the VBA project with a password (VBE > Tools > VBAProject Properties > Protection)
- Copy the worksheet with the event code to a new workbook
The workaround for this problem involves 2 steps:
- Protect the workbook's structure:
File > Info > Protect Workbook > Protect Workbook Structure or
Review > Protect Workbook > [Protect workbook for structure] to prevent worksheet copying. - Include only minimal code in the worksheets. Place the bulk of any such code in a standard module and call on it from the worksheet.
Move/Copy button shown disabled when
Workbook Strucutre is protected
A second alternative is to use a Class Module with Events, instead of using event code in a document (sheet) module. |
Protect VBA Code With Unviewable+
What if you didn’t need to worry about others modifying or even stealing your code? With the Unviewable+ VBA project, this thought is now a reality!
How To Copy Worksheets Without Embedded Code
There are times when worksheets with VBA code may have to be copied (manually or by VBA) and saved to a new workbook:Sheets('Sheet1').Copy
ActiveWorkbook.SaveAs ...
An error or unexpected results could occur, if the event code is triggered in the new workbook, besides the fact that the code would be readable without a VBE password, as discussed earlier.
Here are several options, which could be used to exclude the VBA event code from being included in the new workbook:
- Save new workbook in a macro-free format, when using Excel 2007 or later version (xlOpenXMLWorkbook, see XlFileFormat Enumeration)
- Copy the data range (not the source sheet) to a new macro-free (document module) worksheet
- Delete all worksheet event code in the destination worksheet using the VBA extensibility library.
The function shown below deletes code inside Excel document modules:
Unlock Password Protected Vba Project
Please enable JavaScript to view the comments powered by Disqus.comments powered by Disqus
Password Protected Vba Project
Home » Articles » Security tip: Sheet VBA code can be read, even if VBE is locked