LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to program a code to die


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to program a code to die davidm Excel Programming 0 November 2nd 05 11:14 AM
Problem with a program code highjumper[_6_] Excel Programming 3 August 25th 05 05:14 PM
code for program run once everyday Angus Excel Programming 2 August 2nd 05 07:44 AM
[HELP] closing a program with VBA code Andr? Palmela Excel Programming 2 October 21st 04 05:47 PM
Searching for VB Code to Link to Program PM_24_7 Excel Programming 0 November 18th 03 05:20 PM


All times are GMT +1. The time now is 11:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"