View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Venkatachalam Venkatachalam is offline
external usenet poster
 
Posts: 7
Default DateFormat (dd-mmm-yyyy) (dd-mmm-jjjj) Problem.

Hi Ron,
Thanks for your reply.

Still the problem exists. Even If I specify as NumberFormatLocal, still
my application try to set data format as dd-mm-yyyy and in the different
locale (In my case Dutch-Netherlands), excel is not understanding yyyy ment
for year and it display in the excel sheet yyyy as it is, in stead of
displaying 4 digit year.

If I specify jjjj, then it works fine, but problem with the English-US
settings.

Do I have any way to get the current locale date signature from "EXCEL",
so that I can get the date signature during the run time and based on that I
can decided to use YYYY or jjjj or whatever it may be, based on the current
locale settings.

Thanks

With Regs
Venkat

"Ron Rosenfeld" wrote:

On Sat, 27 Nov 2004 09:03:03 -0800, "Venkatachalam"
wrote:

Hi All,
I am using Borland C++ application (An exe application) to get data form
the Database and populating data to Excel with some formating.

In order to format a cell in the excel as date, I am using
Cell.OlePropertySet("NumberFormat", "dd-mmm-yyyy");

It is working fine with US locale setting. When a user with
Dutch(Netherlands) locale uses the same application, then the date displays
something like "06-jan-YYYY". The reason because Excel understands year only
if it is j in Dutch(Netherlands). ie
Cell.OlePropertySet("NumberFormat", "dd-mmm-jjjj");

Now my question is, how can I make it work across all country users?. Please
let me know.

Thanks in advance.

With Regs
Venkat.


I'm not sure of the usage of OlePropertSet, but perhaps you could use either
"NumberFormatLocal" or "Short Date" in your argument list. At least in Excel
VBA, both of those should be aware of the regional settings.


--ron