Solved

Additional controls: less versatile in VBA than VB6

Posted on 2009-05-18
6
297 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
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.
0
 

Author Comment

by:PeterFrb
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.
Thanks,
~Peter
0
 
LVL 3

Accepted Solution

by:
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".


0
Industry Leaders: 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

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

Author Comment

by:PeterFrb
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.
~Peter
0
 

Author Closing Comment

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

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

749 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