Solved

Why Somme VB6 ocx can't register in my Excel 2007 Component under Windows 7 ?

Posted on 2010-09-08
21
672 Views
Last Modified: 2012-05-10
Hi every body.
 I've got a strange problem : I've got 10 pc with windows 7 32bit fresh installed.
Every PC is updated and have Office 2007 SP2 installed.
I use a Excel Component that i use to install on every PC. It work on 8 of the 10 PC and 2 can't work because Excel is saying that some VB6 components are not installed on the computer.
The installation program install everything that the componnent needs. that's why the 8 of the 10 computers are working.
When i get into the code and try to use by example the treeview component that is listed in the reference (i checked for use) and drow it on the form I get an error : the component is not registerd on the computer.

Any idea is wellcome
Thanks a lot
BeBeDuMi
0
Comment
Question by:George
  • 11
  • 10
21 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33632210
You probably need to register the component in Windows using RegSvr.exe.  See the following link:
               http://support.microsoft.com/kb/249873
Excerpt
Note On a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file:
The 64-bit version is %systemroot%\System32\regsvr32.exe.
The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.
Back to the top
Regsvr32.exe usage
RegSvr32.exe has the following command-line options:
Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

/u - Unregister server
/i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall
/n - do not call DllRegisterServer; this option must be used with /i
/s – Silent; display no message boxes (added with Windows XP and Windows Vista)
When you use Regsvr32.exe, it attempts to load the component and call its DLLSelfRegister function. If this attempt is successful, Regsvr32.exe displays a dialog box that indicates success.
0
 

Author Comment

by:George
ID: 33634855
Hello,
i have already tried to register ocx with regsvr32. I opened cmd with administrative rights and then I registered the ocx. mscomctl.ocx etc. Regsvr says everything is goes ok but when i try to use the components then it doesnt works.

When i try to use the treeview as an exemple i pick it up from the toolbox and try to put it on a frame. And each time I get : The compoment is not registerd on your computer .....

Any idea
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33635464
Did you register with the correct version of RegSvr32?  to ensure that you are using the correct version, go to the correct folder of the two below and launch regsrvr32 from that folder.
The 64-bit version is %systemroot%\System32\regsvr32.exe.
The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.

If that doesn't work, you may have to start over by erasing the ocx, registering it, then add the ocx to your form.  
0
 

Author Comment

by:George
ID: 33673935
Ok now the problem is growing ...
On one of the computer with Windows 7 64 bit, where the application was working fine, casper the gost make it wrong during the night.
Yesterday the application was working, today the application does not work anymore ... it says the component is not registered on the computer.
What happend during the night time ? Windows update, update microsoft security essentials ... that's all i see in the update history

any idea ??
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33675652
you need to provide more details about what was included in the Windows Update, but I still believe that the problem is occuring because the activeX.ocx file has been installed/copied to a different Windows System folder then what is shown in the Registry on the Win7 machines,  Rather then trying to determine which Windows System Folder the ocx file should be installed/copied to and registered to, I would try the following on one of the problem Win 7 machines:
1. Unregister the ocx you previously registered.
2. Copy the ocx file to the folder where the application using the ocx is located instead of the Windows System Folder.
3. Re-register the ocx to the folder that the Application file located.
4. test the application and see if it works.

See this link for background info
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/dc655ae2-450a-4df4-b64d-224f3a30f324
0
 

Author Comment

by:George
ID: 33676729
i try to register as u say windows says is ok but when i go into the project referencies there's no microsoft comons controls.
so i add it from the dialog box and then i've got microsoft common controls.
Then if i try to use the object explorer and chose the comdlg32 then excel crash ... by the way i can apply object like treeview / imagelist on forms and excel goes ok.
But i still can open my office 2007 component that uses common controls. It keeps saying that component is not registered on the computer.

Any idea is wellcome.
PS
Sorry for my bad english need to practice a little :)
0
 

Author Comment

by:George
ID: 33676789
sorry is mscomctllib that crash excel
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33677720
OK, I think this link will point you in the right direction.......
http://stackoverflow.com/questions/1903599/getopenfilename-api-call-in-windows-7-wont-allow-direct-access-to-my-documents

mscomctllib......the lib part of the file name indicates that this is a process library which is a new concept under Windows 7.
0
 

Author Comment

by:George
ID: 33712657
Hello,
0
 

Author Comment

by:George
ID: 33712664
Hello,
Some news about my problem :)

Actualy i have registered as Msctl...ocx as administrator
When i try to use the treeview in design mode Excel VBA says that the class is not registered ...
Any idea ?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33713333
See this link:
          http://msdn.microsoft.com/en-us/library/bb773409(VS.85).aspx

Creating a Tree-View Control
To create a tree-view control, use the CreateWindowEx function, specifying the WC_TREEVIEW value for the window class. The tree-view window class is registered in the application's address space when the common control dynamic-link library (DLL) is loaded. To ensure that the DLL is loaded, use the InitCommonControls function.
0
 

Author Comment

by:George
ID: 33716740
Hi,
thanks for your answer but my problem is that i use a excel addin that uses the treeview.
When i try to use the addin it says that the object is not registered on the computer.
When i create a blank project with and i try to create a treeview in design mode (drow the treeview with the mouse on the form) it says : class not registered ...

0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33717472
As far as I know, the Treevew is one of the MS common controls for which I gave you the class info you requested above. Below is more info for you.
        http://www.excelforum.com/excel-programming/633807-missing-microsoft-windows-common-controls-2-6-0-a.html
"To solve the problem, I had to copy the file "Mscomct2.ocx" into the "\System32" folder. Then go to the VBA editor and there, Extras->Reference and select the "Microsoft Common Controls....." selected.
I got that file from the computer wher I made the original file."

See also:
          http://social.msdn.microsoft.com/Forums/en/worddev/thread/d9ba3d51-3bc1-4c59-bcc9-df42ba33431e
 


0
 

Author Comment

by:George
ID: 33717668
Well i've already done all that those guys done and have the same result : class not registered.
there is just one difference : when i add the reference to the Microsoft common controls " Extras->Reference and select the "Microsoft Common Controls....."  " <-- it is not listed in the installed components i have to search for it in the System32 dir otherwise is not shown in the reference list.
I've already registered the ocx with regsvr32 wich is in the system32 dir and i done it with the admin rights. But there still a problem and i really can't understand what.
The system is Windows 7 Pro 32 and Office is 2007

Send a Jack Daniels bottle who those who find the sollution :)
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33717795
Did you read the second link I gave you above, copied below? I think it has the answer...but you have to read it in its entirety.
     
          http://social.msdn.microsoft.com/Forums/en/worddev/thread/d9ba3d51-3bc1-4c59-bcc9-df42ba33431e
0
 

Author Comment

by:George
ID: 33718050
well i read it once again and try the last solution with the .exd files.
I search the computer for those files find and destroy them
Unregister then register and there still the same problem that is getting me really MAD can't understant what's going on and why this is working on other computers and why it stop working on other ... tired ...


0
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 500 total points
ID: 33718502
I believe the answer to your last question is that the ActiveX is working on computers for which it was already registered on before you installed Win 7.  I believe it is not working on computers on which you installed the controls after you installed Win 7 (probably a new computer).  If none of the above works for you, I would do the following:

1. Make sure the control you are trying to register is the correct control,,,I believe it should be "Mscomct2.ocx", not mscomctllib, mscomctl or other names you mentioned in previous posts.  

2.  Make sure it is installed in the correct windows 7 system folder as discussed in this link:
                         http://www.samlogic.net/articles/32-64-bit-windows-folder-x86-syswow64.htm

3..  If the above doesn't fix and you can substitute another machine that has Windows Xp on which the ActiveX has not been installed,   I would install the activeX and then upgrade to Win 7.
0
 

Author Comment

by:George
ID: 33718556
All of the computers are fresh installed with windows 7 pro. None of them where upgraded from windows XP

0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33718662
OK, item 3 above does not apply.  What about items 1 and 2?
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 33719514
This link could be your answer:
              http://www.datadynamics.com/forums/89812/ShowPost.aspx
0
 

Author Comment

by:George
ID: 33721348
Well in fact item 3 was the best idea. I copy the ocx on a PC that never been installed with the Excel Add-in.
And you know what ? I'm happy :)
From the begining i was working with the ocx delivered by Microsoft VB Common Controls package and that was a bad thing

The great idea is also to have a copy with that files :)

Thanks :)

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
A short article about problems I had with the new location API and permissions in Marshmallow
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now