VBA GetSaveAsFilename and SaveAs changes date

F

Frank Brown

I have a vba routine which separates data and copies it into 2 different
worksheets.
The data is made up of columns of various types, with two columns as
dates.
The dates in the spreadsheet are displayed in the format yyyy.mm.dd.
The code then saves two Tab-delimeted files using the
Application.GetSaveAsFilename and ActiveWorkbook.SaveAs VBA methods.
The code works perfectly apart from the date aspect which outputs the
date columns as m/d/yy.
Ironically if I do a manual File>Save As> *.txt for each sheet the date
is output perfectly as yyyy.mm.dd.
My computer has the international settings as English (United States)
and the formatting for the columns concerned is set to yyyy.mm.dd. It is
only when the vba does the job that it goes wrong.


** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Business Software Galore!
Free Excel Forum http://www.ozgrid.com/forum ***
 
Top