Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Mac. Unfortunately, the idea is not just to delete the code. I need the procedure to self-destruct after a specified date. I have since my last post been able to come up with the following which serves the purpose. (The message boxes are for debugging only and may not be required in actual application). Sub CodeToExpireAfterDateA() Dim x As Date x = #11/05/2008# If x Now() Then MsgBox "Code is alive" 'optional Call TimedCode Else MsgBox "Code has passed used-by date" 'optional Exit Sub End If End Sub The routine of course returns "Code is alive" in this instance and calls up "TimedCode". But run after midnight of 11/05/2008, the 2nd message should be returned and the procedure exited. David David -- davidm ------------------------------------------------------------------------ davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645 View this thread: http://www.excelforum.com/showthread...hreadid=480988 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to program a code to die | Excel Programming | |||
Problem with a program code | Excel Programming | |||
code for program run once everyday | Excel Programming | |||
[HELP] closing a program with VBA code | Excel Programming | |||
Searching for VB Code to Link to Program | Excel Programming |