Got any Excel Questions? Free Excel Help.
Protect/Lock Excel VBA Code
When we write VBA code it is often desired to have the VBA Macro code not visible to end-users. This is to protect your intellectual property and/or stop users messing about with your code. Just be aware that Excel's protection ability is far from what would be considered secure. There are also many VBA password recovery for sale on the www.
To protect your code, open the Excel Workbook and go to Tools>Macro>Visual Basic Editor (Alt+F11). Now, from within the VBE go to Tools>VBAProject Properties and then click the Protection page tab and then check "Lock project from viewing" and then enter your password and again to confirm it. After doing this you must save, close & reopen the Workbook for the protection to take effect.
The safest passwords to use are ones that use a combination of upper, lower, numbers and text. Be sure to write it down though!
|Excel VBA: Hide/Show Pivot Table Field Items|
|Printing PivotTables & PivotCharts|
|Refresh Pivot Table via VBA|
|Prevent Save As in Excel|
|Prevent Excel Being Saved With Another Name|
|Prevent Save Prompts in Excel|
|Excel VBA: Determine Number of Pages to be Printed|