?
Solved

EXCEL FORM DATE PICKER ERRORS

Posted on 2007-11-22
5
Medium Priority
?
968 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 2000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

718 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