Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
AM AM is offline
external usenet poster
 
Posts: 41
Default Protect View Code?

Is there a way to protect view code (I mean users cannot right click and view
code?)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Protect 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.



---
Regards.
Norman


"AM" wrote in message
...
Is there a way to protect view code (I mean users cannot right click and
view
code?)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Protect View Code?

"Norman Jones" wrote in message
...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
AM AM is offline
external usenet poster
 
Posts: 41
Default Protect View Code?

Thank you all for the help. Very helpful and great people on this board.

Best,
AM

"Norman Jones" wrote:

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" wrote in message
...
Is there a way to protect view code (I mean users cannot right click and
view
code?)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can protect worksheet then workbook but not Protect and Share in code [email protected] Excel Programming 7 January 16th 17 07:01 AM
Protect a sheet so only certain people can view it... JC Excel Discussion (Misc queries) 2 February 24th 09 05:47 PM
Can you protect a sheet so that no one else can print, only view? starqueen43 Excel Worksheet Functions 2 October 7th 06 12:21 AM
Password protect for view only Kathy Excel Discussion (Misc queries) 2 April 5th 06 05:04 PM
Protect to view VBE in Excel Rao Ratan Singh New Users to Excel 1 February 24th 06 01:28 PM


All times are GMT +1. The time now is 06:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"