Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Dealing with date formats on expiration date

Hi,

I've coded my model so that it is no longer usable after a defined
expiration date by using the following:

Sub auto_open()
Dim ExpiryDate As Date

ExpiryDate = "4-Ene-2008"

If Date ExpiryDate Then
MsgBox ("The trial time has expired")
ThisWorkbook.Close savechanges:=False
End If

This code works just fine on my computer. However, I'm afraid the
defined value for the ExpiryDate variable (in this case is "4-
Ene-2008") might not be recognized on a different computer due to
regional specifications (the month could be read as "Jan" rather than
"Ene", the spanish equivalent). How could I define a date that can be
understood by any computer in the world?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Dealing with date formats on expiration date

Hi

You can use

If Date DateSerial(2003, 4, 1) Then


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"bliten_bsas" wrote in message ups.com...
Hi,

I've coded my model so that it is no longer usable after a defined
expiration date by using the following:

Sub auto_open()
Dim ExpiryDate As Date

ExpiryDate = "4-Ene-2008"

If Date ExpiryDate Then
MsgBox ("The trial time has expired")
ThisWorkbook.Close savechanges:=False
End If

This code works just fine on my computer. However, I'm afraid the
defined value for the ExpiryDate variable (in this case is "4-
Ene-2008") might not be recognized on a different computer due to
regional specifications (the month could be read as "Jan" rather than
"Ene", the spanish equivalent). How could I define a date that can be
understood by any computer in the world?

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
Calculat an expiration date old coach Excel Worksheet Functions 0 February 23rd 09 03:55 AM
Expiration Date countdown Colin Hayes Excel Worksheet Functions 3 January 15th 09 01:23 PM
Date check for expiration A[_4_] Excel Programming 1 April 14th 07 04:29 PM
Expiration date on Macro Borg Excel Programming 4 August 1st 06 05:24 AM
Code For Expiration Date Juan[_3_] Excel Programming 2 October 25th 03 09:15 AM


All times are GMT +1. The time now is 08:20 AM.

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"