I have a CSV file with a column of dates in US format (my regional formatting is UK). If I open the CSV file in excel and then save the file manually it modifies the date entries slightly (if recognised as valid UK dates) but saves them in the same format. However, if I save the workbook with a macro using ActiveWorkbook.Save the dates are reversed (the ones that are recognised as valid UK dates that is).
What the heck is going on? How do I save with a macro and avoid this?
Example input file:
Date
06/02/2020
06/30/2020
07/13/2020
07/22/2020
07/31/2020
08/11/2020
08/11/2020
08/31/2020
09/22/2020
09/29/2020
After manually saving:
Date
6/02/2020
06/30/2020
07/13/2020
07/22/2020
07/31/2020
8/11/2020
8/11/2020
08/31/2020
09/22/2020
09/29/2020
After saving with macro:
Date
2/6/2020
06/30/2020
07/13/2020
07/22/2020
07/31/2020
11/8/2020
11/8/2020
08/31/2020
09/22/2020
09/29/2020
Solution: The solution as pointed out in Ron's answer was to replace the Save line with SaveAs setting the Local variable to True so it didn't use the VBA US region default.
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.FullName, Local:=True
Application.DisplayAlerts = True