Protect View Code?

  • Thread starter Thread starter AM
  • Start date Start date
A

AM

Is there a way to protect view code (I mean users cannot right click and view
code?)
 
Hi AM,

In the VBA editor:

Menu | Tools | VBA Properties |
Protection | Lock Project foe viewing [x] |
Enter and confirm password | OK
Save, close and re-open workbook.
 
Norman Jones said:
Hi AM,

In the VBA editor:

Menu | Tools | VBA Properties |
Protection | Lock Project foe viewing [x] |
Enter and confirm password | OK
Save, close and re-open workbook.

THat's not a secure means,

Best way is to comppile the code into a VB 6 DLL, and just have stubs in the
the .xls.
For example, using Word, the following is in my Normal.dot, but the real
code is in a DLL.
Same can be done in Excel.

Option Explicit
Public clsWordVBNormal As WordVBNormal

Public Sub AutoClose()
SetupClass
clsWordVBNormal.clsAutoClose
End Sub

Public Sub AutoExec()
SetupClass
End Sub

Public Sub AutoExit()
SetupClass
clsWordVBNormal.clsAutoExit
End Sub

Public Sub AutoNew()
SetupClass
End Sub

Public Sub AutoOpen()
SetupClass
End Sub

Public Sub ResetToolsOptionsView()
SetupClass
clsWordVBNormal.clsResetToolsOptionsView ActiveDocument
End Sub

Private Sub SetupClass()
If TypeName(clsWordVBNormal) <> "WordVBNormal" Then
Set clsWordVBNormal = New WordVBNormal
clsWordVBNormal.SetClass Application
End If
End Sub
 
Thank you all for the help. Very helpful and great people on this board.

Best,
AM

Norman Jones said:
Hi AM,

In the VBA editor:

Menu | Tools | VBA Properties |
Protection | Lock Project foe viewing [x] |
Enter and confirm password | OK
Save, close and re-open workbook.



---
Regards.
Norman


AM said:
Is there a way to protect view code (I mean users cannot right click and
view
code?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top