[RESOLVED] Date format changes when saving Excel as csv
I am having date formatting problems when saving an Excel file in csv format. The dates in the Excel spreadsheet are originally formatted as dd/mm/yy but after converting to a csv file the dates get changed to mm/dd/yy format.
I can see no way of stopping this happening and worse I am not convinced that this always happens the same on all target machines.
I am using MS Excel 2000.
The conversion is being done by - wkb.SaveAs FileName:="Myfilename.csv", FileFormat:=xlCSV
Does anyone have any ideas as to how I can gain control of the date format that ultimately appears in the csv file?
Re: Date format changes when saving Excel as csv
Moved to office development, might get more help there.
Re: Date format changes when saving Excel as csv
When you format a cell in Excel (or a field in Access, for that matter), you're only formatting the appearance of data in that cell, not the actual value stored there. When you export the data (or use it in other ways), the actual stored value is exported.
When you're in the cell, look at the value in the formula bar above the worksheet. That's the actual value.
You'd have to either enter dates in Excel in the format you want manually (in which case their data type would be text), or format the values in the .csv file.
Re: [RESOLVED] Date format changes when saving Excel as csv
Many thanks for explaining this.
I had not quite understood how csv files work.