Date format when opening a .CSV file programmatically

  • Thread starter Thread starter jason
  • Start date Start date
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
 
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
 
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.
 
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
===========================================
 
Back
Top