Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Protect/hide VB code?

I am distributing an excel spreadsheet which includes cartographic functions
written in VB. They are starting to be used
in critical operations like search and rescue so I want to hide & password
protect the VB to prevent code changes, just as
you can with sheets and cells.
Is there any way of doing this? I happen to be using Office 2003 but the
code should be usable with previous and later versions.
Regards
Phil.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Protect/hide VB code?


"Phil B" wrote in message
...
I am distributing an excel spreadsheet which includes cartographic
functions written in VB. They are starting to be used
in critical operations like search and rescue so I want to hide & password
protect the VB to prevent code changes, just as
you can with sheets and cells.
Is there any way of doing this? I happen to be using Office 2003 but the
code should be usable with previous and later versions.
Regards
Phil.

Sorry - a senior moment.
http://www.ozgrid.com/VBA/protect-vba-code.htm answers it!
Phil


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default Protect/hide VB code?

"Phil B" wrote in message
...

"Phil B" wrote in message
...
I am distributing an excel spreadsheet which includes cartographic
functions written in VB. They are starting to be used
in critical operations like search and rescue so I want to hide &

password
protect the VB to prevent code changes, just as
you can with sheets and cells.
Is there any way of doing this? I happen to be using Office 2003 but

the
code should be usable with previous and later versions.
Regards
Phil.

Sorry - a senior moment.
http://www.ozgrid.com/VBA/protect-vba-code.htm answers it!


Password protecting does not protect the code, there are ways to see such
code.

Best is to use VB 6 and compile DLLs, then include only a skeletal bit of
code in VBA to use the DLLs.,

For example, using MSFT Word, the code below is in my Normal.dot file.
The class is compiled into a VB 6 DLL.
And, the very same DLL is used for Word 2000, Word 2002, and Word 2003.
Similar things can be done with 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


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
How to protect & hide Sheet Panchi[_2_] New Users to Excel 3 December 27th 09 07:27 PM
HIDE AND PROTECT A CELL NEIL Excel Worksheet Functions 0 March 8th 07 08:55 PM
Protect hide worksheet Lawrence Excel Worksheet Functions 4 December 20th 05 12:48 PM
Hide/Unhide in Code; Protect, Unlock, etc. Sandy Excel Programming 3 September 12th 05 03:28 PM


All times are GMT +1. The time now is 11:16 AM.

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"