LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA Setting .Value to a date does not respect local system setting

"keepITcool" wrote
the isdate function's description from vba help..
Returns a Boolean value indicating whether an expression
can be converted to a date.
the crux is in the word CAN..


....excepting in this case it can't be displayed (visually) as a date -
although it does not cause an exception so I guess that meets the CAN
criteria!

plus there are some differences between VBA and Excel functions.


Understood - however it was the VBA giving me the heartburn.

I ran a few loops (swapping system separators)
and determined that vba's string interpretation is based on ALL
of the following user's locale settings...
listseparator,decimalseparator,dateseparator,hours eparator
(optionally including the am pm indicators..)


Yuk!

funny as you'd expect it to be based on either
locale's or usenglish Date separator.


I agree. It looks like an each way bet being placed - I presume somehow in
response to something like (as I understand them) the European formats for
dates like yyyy.mm.dd and decimal numbers like 999.999.999,99 ie. the same
char being used in different contexts.

The Q214233 article mentions in respect of dates
a.. If a number contains a slash mark (/) or hyphen (-), it may be
converted to a date format.
It isn't nearly as comprehensive as your research shows it needs to be in
respect of commas etc!

also see harlan grove's article "an interesting read"


It was very interesting! As it happens I have a B.Sc majoring in Zoology
and the risk this trait poses for genetic analysis is not lost on me! I'll
bet the smart alec's that though they would help us all out by casting
"likely" dates etc didn't see this one coming! Do you know if there is any
way to disable this "feature" without having to go to the lengths of
preformatting the cell?

Cheers
Frank.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting default filter setting tpeter Charts and Charting in Excel 0 December 4th 09 02:50 PM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
Sending email via macro- setting the importance setting. Julian Milano[_2_] Excel Programming 1 January 20th 04 10:15 PM
Help with setting up an Ordering system, please Stuart[_5_] Excel Programming 1 December 7th 03 03:59 AM
Setting the system clock with excel ccdubs Excel Programming 3 August 7th 03 09:21 PM


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"