0

I have so many problems with any of the VBA/VB projects, that I am by now not sure which category these problems falls in. Some of the issues listed below may or may not be interrelated. But any thing that is related to visual basic project is causing me so many problems since 1 year. I have researched so many time but have not got a solution till date :(. But this time I could not stand it any more and therefore I am here to post it.

I had Microsoft visual basic 6.0 installed in my system last year. I was able to create some small windows based forms->compile and run as well. However, when I have a project from external resource for supporting VB applications, none of the project were compiling and running through IDE. So i researched a lot and found the below issues:

  1. Missing references/missing dlls. added references but no use

  2. Tried help got this error: msdn collection does not exist please reinstall msdn

  3. Tried Compiling - got error: Compile error: cannot find project project or library

  4. Tried adding components : failed by getting error Dlls are not registered.
  5. Error in project loading, found the below error

enter image description here

  1. Then I tried registering the MSCOMCTL.OCX file through regsrv.exe but it gave admin related errors as below

call toDllRegisterServer failed with error code 0x800280c

Even though I have all admin rights and I am logged in as admin for command prompt.

I also had copied the files from syswow64 to system32 or vice versa whichever way it did not work

Somewhere I had googled that we need to unblock the files to register , but these files were not blocked. Tired, I just left the problem just like that due to other prioritised work.

But again today my colleague gave me an excel sheet which had macros written in it. These macros do not run, instead it redirects me to Visual Basic for application IDE where the first window i get is Compile error followed by automation error enter image description here

Again I thought of researching more on to it, and finally found from SO only that we should be registering MSCOMCTL.OCX. But no matter what I do, I am unable to register any dlls. Can any one tell me what is causing so much of compile issues , the solution and why I am not able to register any dlls or files?

And by the way, my system is window 7 64 bit and I seem to be only one in the workplace having this problem. This issue was present even before any updates. The same profile with the same updates are running in my colleague's system. Even though there were no patch updates etc.

Khushi4.net
  • 329
  • 1
  • 15
  • 1
    VB6 is a bit outdated you know... I stopped it 18 years ago :-) What happens if you manually add MSCOMCTL.OCX to your project references ? (in the references you can browse your HDD for a specific library). Try both 32 and 64 bit versions: `C:\Windows\sysWOW64\MSCOMCTL.OCX` and `C:\Windows\system32\MSCOMCTL.OCX` – Thomas G Aug 31 '17 at 12:14
  • Possible duplicate of [VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323](https://stackoverflow.com/questions/11982719/vb6-ide-cannot-load-mscomctl-ocx-after-update-kb-2687323) – C-Pound Guru Aug 31 '17 at 14:48
  • @ThomasG Thanks for the replying, I have already tried manual addition and this made no difference. I know VB6 is very old, but we do have some legacy application to support currently. By the way, even if manual addition of references might even solve the application project issue but I still do not get the reason for Macros not running in excel sheets. – Khushi4.net Sep 04 '17 at 09:48

1 Answers1

1

Try this:

Open a Command Prompt:

Open START menu, in Search box enter: cmd.exe, a link will shows, BUT doesn't press Enter key, instead RIGHT-CLICK on the link to open context menu, then choose Run as administrator

A Prompt DOS (black) windows will open on C:\Windows\System32 folder.

If your OS is 32 bit then type the below commands:

regsvr32 mscomctl.ocx  press Enter
regtlib msdatsrc.tlb   press Enter

If your OS is 64 bit, need to navigate to C:\Windows\SysWOW64 folder: Type the command:

CD C:\Windows\SysWOW64

then press Enter key to confirm.

Type the below commands:

regsvr32 mscomctl.ocx press Enter
regtlib msdatsrc.tlb  press Enter

Now should working HTH

Giorgio Brausi
  • 414
  • 3
  • 7