Additional controls: less versatile in VBA than VB6

Posted on 2009-05-18
Last Modified: 2013-12-26
When I run a VB6 program, and select Project/Components, I have the option to browse for the component of choice if the desired one is not already in the list of avialable objects.  On the other hand, when using a form in VBA (Excel, Access, etc.), when I select Tools/Additional Controls, I do not have the option to browse for my own control.  I have designed some tailored controls in VB6 and would like to make use of them in my VBA application, and I'm wondering whether that is possible.
Thanks, ~Peter Ferber
Question by:PeterFrb
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
  • 3
  • 2
LVL 15

Expert Comment

ID: 24416946
Yes you can do it.

For example, on Microsoft Access you can do the following steps:

1. Open a form in design mode
2. Go to Tools -> ActiveX Controls
3. If the control doesn't appear on the list, just click the button "Register" to add it.

Please understand that when you are on VBA you are not on the form, so you cannot add ActiveX controls in there. Use the 3 steps above.

Author Comment

ID: 24417330
Thank you, that is excellent information.  Is this same functionality available in Excel.  That's what I was using when I posted the question; and I see the menu you describe in Access, but not in Excel.

Accepted Solution

jakemdrew earned 500 total points
ID: 24417334
I have also found in some cases you have to use RegSvr32 "c:\my_control_path\my_contol_name.ocx in order to get the activex control to show up on the access list.

If you are in Ms Access there will be a button on the toolbox for more controls.  In other Office applications you have to right click on the toolbox and slect "more activex controls".

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 15

Expert Comment

ID: 24417451
On Excel I think you should enter to Visual Basic editor (Alt+F11), add a form, and then go to "Tools -> Aditional Controls" (or something like this: my Excel is not in English).

Please let me know if it works.

Also, registering manually the component using RegSrv32 should be possibly a required step.

Author Comment

ID: 24418032
Well, this is an excellent conversation.  I have a control I designed in VB6 (*.ctl) that includes a WebBrowser object (ieframe.dll).  I am unable to register my own tailored control, and every time I attempt to register ieframe.dll, I get the error message "DllRegisterServer in ieframe.dll failed.  Return code was: 0x80004001".  

What finally worked for me is to use VB6 to create an ActiveX control: an *.ocx file, which included a web browser.  I then used RegSvr32 to register my ocx file, and this was then visible and avaialable to my Excel file for me to successfully include as a component.  I ended up going further than was originally suggested, but I'm definitely going to give credit where it's due.  I would not have known to pursue RegSvr32 without you, and I'm grateful for finally connecting being able to connect all the dots.

Author Closing Comment

ID: 31582797
A really good discussion on a subject that's about as obscure as it is vitally important.  My thank!

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

691 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