Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format an Excel Column in the window's short date format.
I'm trying to use com to format an Excel column as a date in window's short
date format. It works for most regional settings but not Norwegian(Bokmal). To test this I set my regional settings to Norwegian(Bokmal) in control pannel. ( I have US windows xp and excel 2003 ) I call GetLocaleInfoW() to get the regional window's short date setting and it returns 'dd.MM.yyyy' which is correct I believe. I then set the NumberFormat Property of the Excel Column object to 'dd.MM.yyyy' by converting the unicode received from GetLocaleInfoW to a bstring. To my surprise a date such as 12 January 2006 appears in that column as 12.01.yyyy instead of 12.01.2006 as I expected. using the NumberFormatLocal format produced the same result. It appears that when regional settings are set to Norwegian(Bokmal) 'yyyy' is not the correct date formating code for the year portion of the date. If anyone can point me in the right direction on how to format a column for the window's short date format for various regional settings, I'd greatly appreciate it. using the date string from GetLocaleInfoW() isnt a useful approach. I was hoping there was a format string that allowed setting the date format for a column to the window's short date format without having to construct a string such as 'dd.MM.yyyy' which appears problematic. Jim Kane |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why can't I convert Long date format to Short date | Excel Discussion (Misc queries) | |||
Storing data in Short Date format | New Users to Excel | |||
OFC 07 wrkbk saved short date format changes to general when reop | Excel Discussion (Misc queries) | |||
short date format not working while i try to excel afte | Excel Discussion (Misc queries) | |||
one column on my excel spreadsheet will NOT format the date | Excel Worksheet Functions |