We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Excel VBA DTPicker

NewToVBA asked
Medium Priority
Last Modified: 2012-05-11
Hello Experts - How to set DTPicker controls such way that the output value will be default current time and date now()  unless user selects thier own date and time? I just need to pick up the selection and use in my code. Couldn't find a straight answer....
cheers, v
Watch Question

DTPicker.Value = Date()


Hi Sid, I tested it and found issues.
The output I with the code is with extended full format, e.g., Tuesday, April ,  no matter what format I define in
the object properties or the code itself, as you suggested. The form behaves pretty erratically, cannot define relation
between the object settings vs those in the code.  Any examples of how to mange that will be greatly appreciated.

Cheers V
Show me the exact code that you are using?



Hi Sid; I attached a test file pretty much showing what I am after. The objective is to display in the box date and time in format "mm/dd/yy hh:mm". What I get is the extended format, while the output, i.e., DTPicker.value is in the fine. I played with the object settings trying to stay within reasonable range of options, like "mmm/dd/yy", ddd/mm/yy", "yy/mm/dd",etc.,  and got some very strange results, e.g., "45/53/11" etc. I expected to control the format as Excel does anywhere else.

Many thanks, V DTPicker-Test.xls
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview


Many thanks, Sid!

Bill Gates -  listen to Sid, and fix those stupid MS inconsistences!!
Whoa :)

Bill doesn't need my advice :) I am sure this has already been highlighted to the MS Team. Please note that DTpicker is a vb6 control and vb6 is now dying :( (I love vb6) so I doubt if anything can be or will be done about it.

Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.