Protecting VBA code

Steps to protect VBA project in Excel, posted here for reference mainly.
An answer sent to someone asked the question.
This is related to Protect VBA on how to protect VBA project using code.

CodeFunctionName
What is this?

Public

Tested

Original Work
Hi
Please find attached the steps for protecting a workbook
Excel has several methods of protecting its content, but protecting VBA code has to be in sequence

1-    Step1 and Step2: Workbook has to be saved as xlsb, which is the binary format of workbook (you can also save as xls, but new versions of Excel started to complain about that), none of the other format would work
2-    Step3: In VBE (Visual Basic Editor) go to Project Properties
3-    Step4: In Protection tab enter password.
4-    Step5: It is very important to have a password that is long, too long maybe, like 25 characters or more, in some projects I did a password in non-English letters (Like Arabic) to make it very hard to guess.

Once you do that, you are protecting the code from almost 90% of people
Please note as I mentioned, there are some tools that might be able to crack these passwords, but for a password with 16 chars, you need to have a powerful computer to run few weeks to crack the password.
That is why we suggest to have a long password, with 20 chars or more. To make the effort spending weeks to crack almost worthless.

Views 102

Downloads 44

CodeID
DB ID

ANmarAmdeen
608
Attachments
Revisions

v1.0

Wednesday
July
6
2022