Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


My VB6 will not allow me to use Microsoft Windows Common Controls-2 6.6 Saying that the Object Library not registered

Posted on 2014-12-11
Medium Priority
Last Modified: 2014-12-19
I know that the mscomct2.ocx was registered correctly, But vb6 Disagrees so I cant use the dtpicker control.
Question by:RichardLudkiewicz
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
  • 6
  • 6
LVL 13

Expert Comment

by:Chris Raisin
ID: 40495390
There are several things you must do to register this component:

1. I assume you are running a Windows 7 PC (64Bit) PC since this error has occurred. You will need to copy the MSCOMCT2.OCX file to  "C:\Windows\sysWOW64" not "C:\Windows\system32".

2. Make sure you have mscomct2.ocx included in references within VB6 by clicking on Insert/Componements and browsing to the "SysWOW64" folder to add it to references.

Add OCX component to references
3. You must then register the component by running RegSvr32.exe from the command prompt:  
"regsvr32.exe c:\windows\sysWOW64\mscomct2.ocx"

Make sure that you run this command with administrator privileges. It is best to go into cmd.exe by
clicking on the "Start" button then typing "cmd.exe". You then right mouse-button click (RMBC) on the listed program "cmd.exe". From the context menu that appears choose "Run as administrator"). When the component registers correctly you will get the message:

OCX successfully regsitered
If you are not running a 64 bit machine then you can still register as per above, but place the compenment in the "C:|windows\System32" folder instead.

I hope this solves your problem.

Author Comment

ID: 40495968
I'm very sorry but it does not, I get all the correct responses on registering the component but when I go into VB6 and try to add the control to my project it comes up with The error message (Object Library not registered).
I have followed all off your instructions to the letter.  I should also add that this used to work ok on my old C drive but it went down and I had to replace with a new one, all programs and games are installed on a separate drive.
LVL 13

Expert Comment

by:Chris Raisin
ID: 40496092
The control may be corrupted.

Try obtaining it again from a trusted source.
If you cannot find it I can upload via "EE Stuff".

The size should be:  647KB

It all worked for me and I attached a DTPicker to a form (showing a date). No problems.
But that, of course, is in a native VB6 application.

I know DTPicker has problems in Exceland other office applications when using VBA.

If you are doing this via VBA then an alternative object (much better) is obtainable from:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=543 (Userform Calendar Control).

With VB6, do you have Service Pack 6 for a 32 bit machine? I cannot understand why it does notwork on your system.

Addendum: After a bit oif investigation, I suddenly realise that SysWOW64 is actually for 32 bit applications/components on a 64 bit machine, while c:\Windows\System32 is for 64 bit applications/components (does not seem to make sense, but there we go)! LOL :-)

I had a look at my c:\Windows\System32 folder and the component is NOT there, so it must be a 32 bit component (in the SysWow64 folder).

Make sure it is ONLY in your SysWOW62 folder.

You could try "unregistering" it using RegSvr32.exe and then re-register it.

Let me know how you go. When it installs, there are 5 components made available to the toolbox:
DTPicker, FlatScrollBar,UpDonw, MonthView and Animation.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


Author Comment

ID: 40496322
I have done all off the things you have recommended including downloading a new OCX and unregistering and then re-registering the OCX and still VB6 is Telling me that the (Object Library not registered)  even though its in the list. This is very important for me as I have at least 10 apps that I cant update anymore. The mscomct2.ocx I have is 633 KB there are no extra mscomct2.ocx on the C drive but there is an mscomct2.inf file in the same place.
LVL 13

Expert Comment

by:Chris Raisin
ID: 40497577
I have four files in my SYSWOW64 Folder:

Files related to MSCOMCT2.OCX:
You could try renaming your "inf" file to "mscomct2.inf.old" then reboot your machine.
Another possibility is that VB6 is at fault (unlikely) so you could try uninstalling VB6 then re-installing, but before doing that, try getting the files I have available through the following link, installing then in your SYSWOW64 folder, then registering the OCX file as described earlier.


By the way, you should reboot after running REGSVR32.exe registration.

Let me know how you go.

Author Comment

ID: 40497801
I have done all that you have told me to do, the vb6 installation took out the oca so I copied it back and re-registered and all was fine rebooted the computer and started vb6 opened my app and tried to add the Microsoft Common Controls-2 6.0 And vb6 came back again with (Object library not registered).
Something you said at the beginning is bothering me,

Your Quote
2. Make sure you have mscomct2.ocx included in references within VB6 by clicking on Insert/Componements and browsing to the "SysWOW64" folder to add it to references.

I don't understand what you mean as the control appears in the list of components.

Author Comment

ID: 40506962
Why Have I not had a solution yet it is very important that a solution is found for my problem.
LVL 13

Expert Comment

by:Chris Raisin
ID: 40507068
Well if it shows in your list of components it has been added to your VB6 references,but that does not guarantee it has been registered.

Can you run the register process again (using regsvr32.exe under "administraion" provileges as detailed earlier) and get a screen capture of its acknowledgment that it has registered?

Once we confirm that it has indeed been registered, then we have reached a dead end.

If you like, I can make a video on how to install this praticulr component and maybe that may highlight something we have "miscommunicated" somehow thusfar.

Sorry about the delay.....I have just lost a family member and my thoughts took a while to get back to Experts Exchange.

LVL 13

Accepted Solution

Chris Raisin earned 2000 total points
ID: 40507314
I have added a short video tutorial on the registration process to YouTube.

Have a look at it here to see if this clarifies things and helps you out.


Author Comment

ID: 40508682
Thank You Thank You It has now worked I watched the video and just added the control from the installable tab and low and behold I have a date time picker thank you very much indeed.

Richard Ludkiewicz

Author Closing Comment

ID: 40508683
We got there in the end, thank you very much
LVL 13

Expert Comment

by:Chris Raisin
ID: 40509066
My pleasure, Richard! Sorry the video was a bit hesitatnt, but it was prepared very quickly without any rehearsal.

I must admit I had not noticed that I was logged on as an administrator (as evidenced in the "cmd" command window) and so perhaps you DO need to be an administrator to register the OCX files via "RegSvr32.exe".

Usually PC's with only one user (like mine) have that one user with administrator "powers". It is only PC's that have multiple users which have one as an administrator and the others as "normal" users.

I am fairly certain that if you install the OCX, "unregister" it and then close your project and start it up again you will get an error when running the program. This is perhaps what happened to you.

Perhaps you created your project on a machine that has crashed and been rebuilt, or you uninstalled VB6 then re-instal;led it (which would clear all the registered OCX's in the registry) or you transferred your project to a new PC where the OCX was laready in use in your project but had not been freshly regsitered.  In any of these scenarios you would receive the error message which weas hainting you.

I guess also (because you stated that you had registered it using the "cmd" run of "regsvr32.exe") that either you were not an administrator at the time, or the OCX was placed in the wrong folder and registered there (in which case it is probably living in TWO folders so just remove it from the 64 bit folder by deleting the file).

Anyway, all's well that ends well, and as you can guess "a picture is worth a thousand words"....That is why I like to create videos whenever I can....It is also better to put them on YouTube because it helps more people (and saves EE disk space!)  :-)

Have a Merry Christmas and safe and exciting New Year........Regards from Australia.


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I'd like to talk about something that is near and dear to my heart: build systems. Without them, building software is all about compiling locally, with software versions everywhere. It can be a mess. Today we are going to discuss building a small di…
How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

610 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