martinez_pedro
New Member
- Joined
- Aug 19, 2009
- Messages
- 28
So i trying to get this macro to delete the module it works just fine if the project is not protected but if it is protected if fails
Does anybody know how to fix this problem
Thank you I appreciate any help
Does anybody know how to fix this problem
Thank you I appreciate any help
Code:
Private Sub Workbook_Open()
Dim exdate As Date
Dim vbCom As Object
exdate = "01/01/2011"
If Date > exdate Then
MsgBox "Sorry please get a new macro from your admin"
Set vbCom = Application.VBE.ActiveVBProject.VBComponents
vbCom.Remove VBComponent:= _
vbCom.Item("Mo3434")
Exit Sub
End If
MsgBox ("You have " & exdate - Date & "Days left to get a new macro")
Application.Save
End Sub