Unlock VBA Project
Posted on 2003-03-09
I have setup A Workbook with A Form...
I have it where... when one clicks on a button... the form shows up..... etc...
Now when they press the button...
It also checks the current date... and I have an expiration date on it...
I have placed this code to run... if the expiration date = the current date...
Dim VBComp As VBIDE.VbComponent
Dim VBComps As VBIDE.VBComponents
Set VBComps = ActiveWorkbook.VBProject.VBComponents
For Each VBComp In VBComps
Select Case VBComp.Type
Case vbext_ct_StdModule, vbext_ct_MSForm, vbext_ct_classModule
.DeleteLines 1, .CountOfLines
The problem.. is... that this code wont run... since I have protected my project with a password...
I want a code... that will unprotect the project before running this code.. like this... it will
run without a problem....
Say the password is XXXXX