T
Toby Erkson
I have set the "Lock project for viewing" in my Project Properties. Just to
keep away casual prying eyes. There is a section in on of my modules where
I delete other modules (but not the one where the code is running):
With ActiveWorkbook.VBProject
'Remove modules from wkbk
.VBComponents.Remove .VBComponents("UpdateKPIdatasets")
.VBComponents.Remove .VBComponents("zSupport")
.VBComponents.Remove .VBComponents("RegExps")
.VBComponents.Remove .VBComponents("UserForm1") 'Remove form from wkbk
End With
I get an error with the first .Remove and everything stops because the
project is protected. Okay, that's to be expected, so is there a way I can
programmatically Unprotect the project? The code does work if I unprotect
my project.
keep away casual prying eyes. There is a section in on of my modules where
I delete other modules (but not the one where the code is running):
With ActiveWorkbook.VBProject
'Remove modules from wkbk
.VBComponents.Remove .VBComponents("UpdateKPIdatasets")
.VBComponents.Remove .VBComponents("zSupport")
.VBComponents.Remove .VBComponents("RegExps")
.VBComponents.Remove .VBComponents("UserForm1") 'Remove form from wkbk
End With
I get an error with the first .Remove and everything stops because the
project is protected. Okay, that's to be expected, so is there a way I can
programmatically Unprotect the project? The code does work if I unprotect
my project.