PC Review


Reply
Thread Tools Rate Thread

Dealing with date formats on expiration date

 
 
bliten_bsas
Guest
Posts: n/a
 
      4th Oct 2007
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 With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      4th Oct 2007
Hi

You can use

If Date > DateSerial(2003, 4, 1) Then


--

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


"bliten_bsas" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different Date formats in text to be recognised as date value swiftcode Microsoft Excel Programming 8 16th Oct 2009 08:37 AM
Assigning a date that is before expiration date Visakha Microsoft Excel Programming 4 3rd Oct 2009 03:32 AM
Cell Date and Listbox Date formats Corey Microsoft Excel Programming 5 12th Dec 2008 11:52 AM
All date formats change any date input to Sept. 17, 2126. =?Utf-8?B?SmVycnk=?= Microsoft Excel Crashes 0 28th Aug 2006 07:34 PM
i have two date fileds Opend date Due date, can i set default on due date so, its always = to open date on my data entry form1 Urgent Mike Saifie Microsoft Access Form Coding 1 9th Mar 2006 01:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:34 PM.