Solved

EXCEL FORM DATE PICKER ERRORS

Posted on 2007-11-22
5
967 Views
Last Modified: 2013-12-25
Experts,

I have produced some vb script that involves some date pickers. Before i send the code to colleagues, i have been trying the code out with other users and have found that i am having sever problems with the 'DATE PICKER' control with other users. For example, the following code returns an error when other users have used it - it is part of the userform intiliastion:

save_date_button.Enabled = False
Date_Picker.CustomFormat = Chr(32)<========= error
Date_Picker.Enabled = False

When i commented this out on the other users machine - and then attempted to use the date picker - another error was thrown out on the date picker mousedown event:

Private Sub Date_Picker_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As stdole.OLE_XPOS_PIXELS, ByVal Y As stdole.OLE_YPOS_PIXELS)
Dim a As Boolean
a = X > (Date_Picker.Width - 285) 'a = true if mouse is over the grey DTPicker button
If a = False Then Exit Sub
If Button <> 1 Then Exit Sub 'allow only left mouse button
If Date_Picker.Format <> dtpLongDate Then Call MakeDtpLongDate<============= ERROR
End Sub

it is like other users are not formatted to use the date pickers - yet the versions of excel they are using are exactly the same! So confused, could anyone please tell me why this is happening?

Thanks

Simon
0
Comment
Question by:simondopickup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 20334240
The Date and Time Picker control is not a standard Excel control. If you have VB6 (or Visual Studio) installed on your machine that may be where you got it from, in which case you need to package it up with the workbook in an installation routine, assuming you have a redistributable version and licence to do so.
Regards,
Rory
PS I assume you are not talking about the Calendar control? (which comes with MSAccess)
0
 

Author Comment

by:simondopickup
ID: 20334259
So this is not something i can set or have installed as the workbook opens?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 20334320
You need to distribute the actual control as it physically does not exist on most computers - it's not just a question of setting a reference. You need to copy the control and register it on each machine. (one reason I never use Date Pickers or Calendar controls)
0
 

Author Comment

by:simondopickup
ID: 20334974
OKay well i have a worksheet that contains 4 date pickers at present. I am going to send this to to lots of colleagues in the states and i dont want the thing to be throwing out errors as soon as they compile it. What would you suggest?
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 20335234
Do you have a copy of VB which entitles you to distribute the control? If so, you will need to create an installation package that includes the .ocx file for the Date Time Picker and distribute that.
Alternatively, remove the controls and let them enter dates manually.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question