By NaN

2019-11-13 16:15:50 8 Comments

I have a VB6 project that I was actively developing on one machine and have had to move the VB6 project over to a different machine running hardware that my program will be talking to. After moving the project, I am getting file not found for comctl32.ocx. The error message includes the path to the file and I've verified that the path is correct and that the file actually exists. I have also registered that OCX file with regsvr32 and it still isn't loading. Is there a way to fix this?

I also noticed that some references that existed on the other development machine offered newer versions of some of the controls I need, like Microsoft ActiveX DAO 2.8 Library. On the new dev machine, I only see Microsoft ActiveX DAO 2.5 Library. I'm not sure why this is because I used the same installation media of VBA on this new dev machine that was used to load it on the other machine. Why do the 2 machines have difference in version numbers for some of the controls?

EDIT1: Looking under Project>References I can see that 2 of them have been labeled as missing. These references are:

  1. Microsoft ActiveX Data Objects 2.8 Library, AND
  2. Microsoft VBScript Regular Expressions 5.5

EDIT2: The "new" development machine is Windows 2000.


@Brian M Stafford 2019-11-13 20:50:00

Sometimes when a project is migrated to a new computer, you end up with missing references. These are never fun to fix. But it essentially comes down to installing the missing files. There are several ways to do this:

Install Set

This is perhaps the easiest way. All dependencies are collected into a package that gets copied to the new computer and registered as needed.

Manually Install

Through a process of prior knowledge or searching the web, install packages are tracked down and applied to the new computer. So, for the issue at hand:

"Microsoft ActiveX Data Objects 2.8 Library" can be downloaded from the Microsoft site.

"Microsoft VBScript Regular Expressions 5.5" are available as part of Internet Explorer 5.5 and possibly more recent versions, too. Install IE and you'll be good to go.

Other Issues

Some components are actually on the computer but cannot be used for whatever reason. In your case with Microsoft Windows Common Controls 5.0 (comctl32.ocx), the first thing to try is as Etienne suggested. At an Administrator Command Prompt, unregister and re-register the control.

Another option is to upgrade your component to Microsoft Windows Common Controls 6.0.

@Étienne Laneville 2019-11-13 17:42:05

Try unregistering comctl32.ocx first:

Type REGSVR32 /U "C:\[filename.dll]"

Then re-register it again as you previously did. I've ran into this problem before and doing so fixed the problem. Make sure you run Command Prompt as Administrator.

As far as your other references, I suggest running Windows Update on both machines. You should have Microsoft ActiveX Data Objects 6.1.

@NaN 2019-11-13 18:27:44

Thanks for the help. I've done exactly what you've suggested and am unfortunately getting the same exact error. I didn't mention it but the "new" development machine is Windows 2000. I'm not sure I can still get updates for this version of Windows.

@Brian M Stafford 2019-11-13 18:53:34

You can also try installing the missing references manually. You can download MDAC from the Microsoft site. I wasn't able to find a link to downloadRegEx 5.5, but I believe it is installed with Internet Explorer 5.5.

@NaN 2019-11-13 18:58:31

Thank you, Brian. I've been on this since I posted and managed to find MDAC on my own. I installed that and it fixed the Data Objects 2.8 Library. Like you though, I also cannot find a download link to the RegEx library. Is this a hopeless issue to find a solution to?

@Brian M Stafford 2019-11-13 19:02:28

I believe you will need to install IE 5.5. I'll dig around a little more and see what I can find out.

@NaN 2019-11-13 19:04:19

@BrianMStafford, Thank you, Brian!

@NaN 2019-11-13 19:10:10

I just looked for IE 5.5 and can't find a copy anywhere online. I'll keep looking. Thanks again, Brian

@Brian M Stafford 2019-11-13 19:30:11

Does the new machine have any version of IE? If not, try installing IE 5.5 or later. My machine has IE 11, and RegEx 5.5 is available. Another option that occurred to me is to create an install set on the original machine and run it on the new machine. This may get the prerequisites onto the new machine.

@NaN 2019-11-13 19:49:17

@BrianMStafford, Brian, I found a copy of 5.5 and installed it on the 2000 machine and miraculously, the reference is working now. How did you ever know that what I needed would be bundled in a copy of IE 5.5?

@NaN 2019-11-13 19:53:54

@BrianMStafford, The only error I'm seeing now is the one for comctl32.ocx. I looked at the project file and I can see that the version listed is 1.5, but when I look at the comctl32.ocx, the version of that physical file is version 6.0. Could this have anything to do with why it's complaining?

@Brian M Stafford 2019-11-13 20:08:14

@NaN I don't think so. My project file has 1.3 and the ocx file is 6.0. Etienne's suggestion should work. At a ADMIN command prompt, unregister and register the ocx.

@NaN 2019-11-13 20:33:30

@BrianMStafford, Brian, I may be closing in on the problem. I created a new project then added MS Common Controls 6.0 then added the slider control to the form (I think this is what is using the comctl32.ocx file). Then I saved it. When I run that new project, I do not get any errors. Could this be as simple as choosing MS Common Controls 6.0?

@Brian M Stafford 2019-11-13 20:41:02

That would be an option. `comctl32' is actually MS Common Controls 5.0 so you'd be going to a newer version.

@NaN 2019-11-13 20:57:10

Brian, I just selected the MS Common Controls 5.0 and no longer get the error for the OCX file, but there is a log file that was written to after I opened the project. It says: Class ComCtlLib.Slider of control Slider1 was not a loaded control class. Does this mean anything to you?

@Brian M Stafford 2019-11-13 21:21:40

Sounds like there's still an issue with the v5 control. If it were me, I would upgrade to v6 and be done with it.

@Hel O'Ween 2019-11-14 16:16:10

You don't need to install IE for Scripting Host. It's available as a standalone download.

Related Questions

Sponsored Content

16 Answered Questions

[SOLVED] VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323

  • 2012-08-16 07:43:12
  • Rumi
  • 190309 View
  • 45 Score
  • 16 Answer
  • Tags:   vb6

3 Answered Questions

[SOLVED] Building VB6 projects without registering

  • 2013-06-18 23:07:31
  • oroboro
  • 581 View
  • 1 Score
  • 3 Answer
  • Tags:   tfs vb6 msbuild

4 Answered Questions

[SOLVED] How do I programmatically update OCX references in vb6 projects?

  • 2009-03-06 21:38:36
  • Craig Gidney
  • 5419 View
  • 4 Score
  • 4 Answer
  • Tags:   vb6 activex

1 Answered Questions

VB6 - User control/ActiveX control - how to get parent dimensions

  • 2015-06-18 14:37:21
  • Phil
  • 859 View
  • 0 Score
  • 1 Answer
  • Tags:   vb6

1 Answered Questions

[SOLVED] Registered OCX file cannot be imported in vb 6

  • 2014-06-09 19:59:12
  • Phil
  • 747 View
  • 1 Score
  • 1 Answer
  • Tags:   vb6 activex ocx

1 Answered Questions

[SOLVED] VB6 Multiple Developers Reference errors

  • 2013-09-13 20:41:23
  • cmhdev
  • 138 View
  • 1 Score
  • 1 Answer
  • Tags:   vb6

2 Answered Questions

[SOLVED] Set VB6 reference to Microsoft Word 97 (Word 2007 installed)

  • 2012-08-22 21:09:05
  • Angus Comber
  • 1751 View
  • 0 Score
  • 2 Answer
  • Tags:   vb6 ms-word

1 Answered Questions

[SOLVED] Can not debug an ActiveX inside a VB6 project with several components inside

3 Answered Questions

Sponsored Content