All Forums >> [Scripting] >> WSH & Client Side VBScript >> Date format issue when writing to Excel **solved** Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I'm having a problem with date formatting when writing to excel. When ever the date has a leading zero (eg. 03/12/2005 - Australian format dd/mm/yyyy) the day and month are reversed when I open the spreadsheet. I have tried formatting the column to dd/mm/yyyy when the spreadsheet is created but the propblem persists. I have also tried using NumberFormat after and before the value is written to the spreadsheet. Pre-formatting the column works when I type a date with a leading zero manually into the spreadsheet, but when the script writes to the spreadsheet the problem persists. I can't even manually reformat it without retyping the date in first.
It needs to be in the correct format (dd/mm/yyyy), with leading zero. Any help or clues would be greatly appreciated.
Here is the test code:
< Message edited by BBistheKing -- 11/24/2007 2:33:13 PM >
_____________________________
"Live simply, that others may simply live." - Mahatma Gandhi