Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculat an expiration date | Excel Worksheet Functions | |||
Expiration Date countdown | Excel Worksheet Functions | |||
Date check for expiration | Excel Programming | |||
Expiration date on Macro | Excel Programming | |||
Code For Expiration Date | Excel Programming |