date handling problem with International issues

B

Brian Murphy

I am reading a date value from a web page into a string variable. The
web server is in the US so the date will always be in English of the
form May 25, 2010. The month name is spelled out in English.

I need to compare this to a date value stored in a Date variable in
VBA. This is on the user's computer in whatever language and WRS he's
using. How is this done? It seems like some sort of date literal
form like #May 25, 2010# is what I need to do, but how is this done at
run time with a US date in a string variable. I tried
application.evaluate but that did not work.

Thanks,

Brian Murphy
Austin, TX
 
B

Brian Murphy

I found the answer in the Green, Bullen, Bovey, Alexander book on
Excel 2007 VBA

VBAdatevbl = CDate(Application.Evaluate("datevalue(""" & UDdatestring
& """)"))

Seems to work like a charm. How those guys figure these things out is
really something.

Cheers,

Brian
 
J

Jacob Skaria

What is the problem with VBScript DateValue Function?

Dim UDDateString As String, VBAdatevbl As Date
UDDateString = "May 25, 2010"
VBAdatevbl = DateValue(UDDateString)
 

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

Similar Threads


Top