Protecting VBA from viewing

Antony

New Member
Joined
Sep 24, 2002
Messages
5
I write VBA code for users in my company.
Is there a way to protect the VBA code from being view by others? Can I compile the code?

Thank you
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Mark O'Brien

MrExcel MVP
Joined
Feb 15, 2002
Messages
3,530
To protect the project from being viewed:

1. Open the VBE
2. Goto Tools|VBAProject Properties
3. Choose the "Protection Tab"
4. Stick your password in.
5. Close and reopen the workbook and the VBA code will require a password to be viewed.

VBA doesn't compile, or at least not in the sense of a stand-alone application. To get some performance results when your project is ready to be shipped:

1. Open the VBE
2. Choose Debug|Compile VBAProject

This doesn't "compile" the VBA project in the sense that you "compile" a VBA project, or more accurately a C or C++ program.

However, compiling the project in this manner creates p-code or whatever the heck it's called, which basically means that your code will work quicker straight out the box.

HTH
 

Forum statistics

Threads
1,144,436
Messages
5,724,343
Members
422,545
Latest member
zillafreak

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
Top