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