Discussion Locked

Opening CSV File in Excel using VBA

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is this an anomoly in Excel, If you open a CSV file in Excel (XP) using VB and there is a column of dates (dd/mm/yy) in the CSV file. when the file opens some of the dates change in the column change to (mm/dd/yy). Weird!
Is this a know anomoly?Is there a Cure?

(Workbooks.Open Filename:=fn) where fn = filename

2 replies

by jackofalltech

This is not an anomoly. The DEFAULT date format (at least in US english installs) is mm/dd/yy(yy).
You can change the format for the column in vb after the import(open).

Ralph

by parli singh

Hi thanks for answer, but if there is a column of say 100 rows
of dates (dd/mm/yy) then when you use VB to open some dates will be in mm/dd/yy and some in dd/mm/yy. Regional Settings are set to UK (dd/mm/yy). Opening CSV without VB works fine.

This discussion is closed to new replies.