Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
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
Need to know formula to make expire in a year. tlbailey79 Excel Worksheet Functions 5 October 3rd 08 09:43 PM
How can I make Excel recognize a time period Michel Excel Discussion (Misc queries) 3 June 19th 07 05:03 PM
Saving a file with time and date at a set time period Mark Dullingham Excel Programming 10 March 3rd 07 12:10 PM
average rate of change per given time period between 2 moments in time of a value David Virgil Hobbs Excel Worksheet Functions 1 December 19th 06 07:24 AM
average rate of change per given time period between 2 moments in time of a value David Virgil Hobbs Excel Programming 1 December 19th 06 07:24 AM


All times are GMT +1. The time now is 02:42 PM.

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

About Us

"It's about Microsoft Excel"