paperworker
Technical User
Is there a way to make Word macro code available for others to use but at the same time hide the code or deny access to the code to protect it from tampering?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sorry, but this does not make sense.The problem is, the macro has to reside in a template on a server so that many people can access it. The lock project feature prevents the macro from being copied through the Organizer into the document where the macro will be run.
Sub Document_Open()
If Application.ShowVisualBasicEditor = True Then
Application.ShowVisualBasicEditor = False
End if
End Sub
Sub ViewVBCode()
Dim response
response = InputBox("Enter your password.")
If response = "zippity do-dah" Then
Application.ShowVisualBasicEditor = True
Else
Msgbox "Visual Basic Editor is not available."
End If
End Sub
Sub Document_Open()
If Application.ShowVisualBasicEditor = True Then
Application.ShowVisualBasicEditor = False
End if
End Sub
Sub ViewVBCode()
If ENVIRONS("username") = "[i]your_loginname[/i]" Then
Application.ShowVisualBasicEditor = True
Else
Msgbox "Visual Basic Editor is not available."
End If
End Sub
Dim ToBeCleaned As Document
Set ToBeCleaned = [i]document_name[/i]
With ToBeCleaned
.yadda yadda
.yadda yadda
End With
Sub CleanUp()
With ActiveDocument
' do this
' do that
' do aome other thing
End With
End Sub
Sub GetEachDoc()
Dim sPath As String
Dim CleanFile
sPath = "c:\test\"
CleanFile = Dir(sPath & "*.doc")
Do While CleanFile <> ""
Documents.Open FileName:=sPath & CleanFile
Call CleanUp
ActiveDocument.Close wdSaveChanges
CleanFile = Dir
Loop
End Sub
there was a way to hide the code but still make it available for people to use.