Is it possible to protect VBA code from different file vba code?
I want to write a macro which for all files in given directory set project properties - protection - lock project for viewing:
Regards, Piotrek
//EDIT
I've tried:
sub setVBAPassword(ws as Worksheet)
dim oVBP as VBProject
set oVBP = ws.VBProject
oVBP.VBE.CommandBars("Menu Bar").Controls("Tools") _
.Controls("VBAProject Properties...").Execute
With Application
.SendKeys "^{TAB}"
.SendKeys "{ }"
.SendKeys "{TAB}" & "test"
.SendKeys "{TAB}" & "test"
.SendKeys "{TAB}"
.SendKeys "{ENTER}"
End With
end sub
problem is, that it is setting password to vb project that runs a macro. question is how can I switch to some other project, or how can I open VBE in other ws context?