Link to home
Start Free TrialLog in
Avatar of PeterFrb
PeterFrbFlag for United States of America

asked on

Additional controls: less versatile in VBA than VB6

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
Avatar of gplana
gplana
Flag of Spain image

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.
Avatar of PeterFrb

ASKER

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.
Thanks,
~Peter
ASKER CERTIFIED SOLUTION
Avatar of jakemdrew
jakemdrew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.
~Peter
A really good discussion on a subject that's about as obscure as it is vitally important.  My thank!
~Peter