Solved

Additional controls: less versatile in VBA than VB6

Posted on 2009-05-18
6
289 Views
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
0
Comment
Question by:PeterFrb
  • 3
  • 2
6 Comments
 
LVL 15

Expert Comment

by:gplana
Comment Utility
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.
0
 

Author Comment

by:PeterFrb
Comment Utility
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
0
 
LVL 3

Accepted Solution

by:
jakemdrew earned 500 total points
Comment Utility
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".


0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 15

Expert Comment

by:gplana
Comment Utility
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.
0
 

Author Comment

by:PeterFrb
Comment Utility
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
0
 

Author Closing Comment

by:PeterFrb
Comment Utility
A really good discussion on a subject that's about as obscure as it is vitally important.  My thank!
~Peter
0

Featured Post

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.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

763 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

6 Experts available now in Live!

Get 1:1 Help Now