Dealing with date formats on expiration date

B

bliten_bsas

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top