PDA

View Full Version : Solved: Problem with date Picker Control



gmulhall
06-06-2010, 10:14 PM
Hi,

I've recently transferred all my work to a new PC with Win XP pro installed. I have a spreadsheet with a macro and form for recording the time spent on projects. The form contains the date picker. I've installed MSCOMCT2.OCX into c:\windows\system32 and run regsvr32 to register the control. Despite this I still get an error "object library invalid or contains references to object definitions that could not be found".

When I investidated further I found that there appear to be 2 instances of MSCOMCT2 available under Toolbox -> Additional controls. One is named Unknown, the other DTPicker.

How do I correct this please ?

Thanks as always,

Geoff

Blade Hunter
06-06-2010, 11:23 PM
Isn't the date picker mscal.ocx? Or at least the one I use is, there are probably a few calendar controls though.

gmulhall
06-07-2010, 02:39 AM
Hi,

See

http://support.microsoft.com/kb/297381

MSCOMCT2.OCX (Microsoft Windows Common Controls-2 6.0) includes the following ActiveX controls:
Microsoft Animation Control
Microsoft UpDown Control
Microsoft MonthView Control
Microsoft Date and Time Picker Control
Microsoft Flat ScrollBar Control

Geoff

lucas
06-07-2010, 09:30 AM
You have discovered the problem with controls that are not installed on every machine such as the calendar control.

It creates a portability problem. Solve it by not using the calendar control.

Click here for one example (http://www.vbaexpress.com/kb/getarticle.php?kb_id=543)

gmulhall
06-07-2010, 04:45 PM
Thanks. I'll look at your code.

I have resolved by deleting the control from the form, then unregistering the control, reinstalling and re-registering and unmarking the control as missing.
But your point about portability is well made.

Thanks again,

Geoff