Skip to content

Commit

Permalink
Fix missing code for VBAToolKit 2003 :
Browse files Browse the repository at this point in the history
- add vtkProtectProject sub in vtkExcelUtilities2003.bas
  • Loading branch information
Jean-Pierre Imbert committed Jan 15, 2015
1 parent 906891e commit fc6a717
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/ConfProd/vtkExcelUtilities2003.bas
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,18 @@ Public Function vtkReferencesInWorkbook(Wb As Workbook) As Collection
Next
Set vtkReferencesInWorkbook = c
End Function

'---------------------------------------------------------------------------------------
' Sub : vtkProtectProject
' Author : Jean-Pierre Imbert
' Date : 05/12/2014
' Purpose : Protect a VBAProject with a password
'---------------------------------------------------------------------------------------
'
Sub vtkProtectProject(project As VBProject, password As String)
' Set active project and work with the property window
Set Application.VBE.ActiveVBProject = project
Application.VBE.CommandBars(1).FindControl(id:=2578, recursive:=True).Execute
' + means Maj, % means Alt, ~ means Return
SendKeys "+{TAB}{RIGHT}%V{+}{TAB}" & password & "{TAB}" & password & "~", True
End Sub

0 comments on commit fc6a717

Please sign in to comment.