Excel 2000 macro changes date format - TechRepublic
General discussion
September 2, 2002 at 05:24 PM
tipscomp

Excel 2000 macro changes date format

by tipscomp . Updated 23 years, 10 months ago

I would like to report a bug in Excel 2000.

If a csv file is opened using a VBA macro, it does not format the dates correctly:

I have a file ‘ABC.csv’ whose first column contains date in the format ‘dd/mm/yyyy hh:mm’.

If I open the file inexcel by double-clicking it explorer or using File/Open menu in excel then the file opens with the correct date format in the first column.

However if I run the code:
Workbooks.Open Filename:=”ABC.csv”

it opens the file with the first column having ‘mm/dd/yyyy hh:mm’ format. If I look at the format of these cells, it shows that its in the format ‘dd/mm/yyyy hh:mm’, even though its not. I cannot reformat the date column either.

This does not occur in excel 97.

This discussion is locked

All Comments