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
  • 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".

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA filters 2 64
Copy a row 12 64
Add a task in Outlook from access 11 42
Automatic Email Reminder 4 57
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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