Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need VBA code to make app expire after period of time
Can someone provide some sample code or reference to make an
application expire after a period of time. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need VBA code to make app expire after period of time
At the start of the sub put something like
If Now() "date and time" Then Exit Sub Else 'the rest of you sub goes here as normal. My only concern is I'm not sure how to put in the date and time that you want finish at. Another alternative is to put the date time in cell AA1 If Now() Sheets("Sheet1").Range("AA1") Then Exit Sub Else 'the rest of you sub goes here as normal. Hope this helps you get on track anyway. "TJ" wrote: Can someone provide some sample code or reference to make an application expire after a period of time. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need VBA code to make app expire after period of time
I just tried this and it worked
If Now() "20/08/2009 3:32pm" Then but If Now() "20/08/2009 15:32" Then didn't work. "NDBC" wrote: At the start of the sub put something like If Now() "date and time" Then Exit Sub Else 'the rest of you sub goes here as normal. My only concern is I'm not sure how to put in the date and time that you want finish at. Another alternative is to put the date time in cell AA1 If Now() Sheets("Sheet1").Range("AA1") Then Exit Sub Else 'the rest of you sub goes here as normal. Hope this helps you get on track anyway. "TJ" wrote: Can someone provide some sample code or reference to make an application expire after a period of time. Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need VBA code to make app expire after period of time
See http://www.cpearson.com/excel/WorkbookTimeBomb.aspx for example
code. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Wed, 19 Aug 2009 19:21:39 -0700 (PDT), TJ wrote: Can someone provide some sample code or reference to make an application expire after a period of time. Thanks. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need VBA code to make app expire after period of time
Visit Chip Pearson's site:
http://www.cpearson.com/Excel/WorkbookTimeBomb.aspx TJ wrote: Can someone provide some sample code or reference to make an application expire after a period of time. Thanks. -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need VBA code to make app expire after period of time
NDBC wrote:
I just tried this and it worked If Now() "20/08/2009 3:32pm" Then but If Now() "20/08/2009 15:32" Then didn't work. What's going on there? Is it converting Now() to a string using the user's locale, and then comparing it to your hard-coded string in your locale? Or does the string get converted to a Date value and then compared? I think you need to protect your code from locality issues by explicitly formatting the date and comparing, e.g. If Format(Now(), "yyyy-mm-dd") = "2009-08-20" Then Phil Hibbs. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need VBA code to make app expire after period of time
On Aug 20, 9:01*am, Chip Pearson wrote:
Seehttp://www.cpearson.com/excel/WorkbookTimeBomb.aspxfor example code. Cordially, Chip Pearson Microsoft Most Valuable Professional * * Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLCwww.cpearson.com (email on web site) On Wed, 19 Aug 2009 19:21:39 -0700 (PDT), TJ wrote: Can someone provide some sample code or reference to make an application expire after a period of time. Thanks.- Hide quoted text - - Show quoted text - Thank, Chip. Much appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to know formula to make expire in a year. | Excel Worksheet Functions | |||
How can I make Excel recognize a time period | Excel Discussion (Misc queries) | |||
Saving a file with time and date at a set time period | Excel Programming | |||
average rate of change per given time period between 2 moments in time of a value | Excel Worksheet Functions | |||
average rate of change per given time period between 2 moments in time of a value | Excel Programming |