How to protect VBA code

PG_Develop

New Member
Joined
May 12, 2017
Messages
7
Hello, collegues

I have faced the following situation: I need to pass my workbook to another user and be sure, that he won't pass it to a third party. So, I would attach workbook to a USB encrypted key by API by macro.

But my question is how to protect this macro (which, I suppose, should be in ThisWorkbook location and execute on Workbook.Open event to check, whether the key is in the PC or not)? I have read about some VBA code "obfuscators", but I am not sure, whether I can obfuscate macro not in a module, but in ThisWorkbook location. Maybe you know some more efficient ways to protect the macro.

If you need some more input data and further clarifications, please do not hesitate to ask me in this thread

Thank you in advance!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi: What about just protecting the VBA with a password? I am not sure if all you are doing is trying to prevent someone from seeing your codes. If so just password protect your project. If so just go to VBA Project (Alt + F11) and then select TOOLS and then VBAProject Properties... and then click on the PROTECTION tab and place a checkmark in "Lock Project for viewing" and then enter a password. DONT LOSE YOUR PASSWORD because you will not be able to get back into your VBA Project without it. I hope this helps.

Take Care,
Mark
 
Upvote 0
Hi: What about just protecting the VBA with a password? I am not sure if all you are doing is trying to prevent someone from seeing your codes. If so just password protect your project. If so just go to VBA Project (Alt + F11) and then select TOOLS and then VBAProject Properties... and then click on the PROTECTION tab and place a checkmark in "Lock Project for viewing" and then enter a password. DONT LOSE YOUR PASSWORD because you will not be able to get back into your VBA Project without it. I hope this helps.

Take Care,
Mark

Mister H,

Thank you for reply. Password would suit, but it is very easy to crack password protection of VBA module.. That's why I am looking for some advanced protection options, such as obfuscation of VBA code, etc.

Thank you,
PG_Develop
 
Upvote 0

Forum statistics

Threads
1,215,301
Messages
6,124,142
Members
449,144
Latest member
Rayudo125

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top