Date format when opening a .CSV file programmatically

J

jason

have a date 05/11/2003 in a cell in a csv file
if I open the file manually it reads 05/11/2003
if I open the file via vba it reads 11/05/2003

(if I right click on the cell in all three above cases the format is
the same Custom - "dd/mm/yyyy")

Any ideas

Jason
 
A

Angus Comber

What Regional Setting is your computer set to?

dd/mm/yyyy is not US format. Possibly default VBA format used for date is
US? Just a guess.

Angus Comber
 
J

jason

Angus,

Have you tried this?!!!
I've just trued this at home and it looks almost like a bug!
Typed 05/11/2003 in A1 and saved it as a csv file.
Closed the file and opened it again manually - still 05/11/2003.
Opened another workbook and recorded a macro of opening the csv file.
Gone back to the recorded macro and run it - now it is 11/05/2003 !!!
(still 05/11/2003 when manually opened)
Regional settings are set to dd/MM/YYYY.

Help.
Jason.
 
B

BrianB

If you try anything with dates in macros you will find that they
default to the american mm/dd/yy and need to be re-formatted.

Regards
BrianB
===========================================
 

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