Solved

Calling object methods without direct

Posted on 1999-01-18
2
131 Views
Last Modified: 2010-05-03
This is a tough one.
I need to call methods in an ActiveX control BUT I can't use the standard object.method to call it. I will only know it's name at run-time.

I need (I know it doesn't exist in plain VB) something like object.methods["methodname"](var1, var2). I could live without any vars.

I also know this can be implemented using the IDispatch interface methods like GetIdsOfNames...

I'm looking for something generic which can take an object and analyze it's properties and methods. I could do it with Delphi or C++, but I need to do it in VB or use something ready.

Thanks.
0
Comment
Question by:ssite
[X]
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
2 Comments
 
LVL 3

Accepted Solution

by:
cognition earned 200 total points
ID: 1469253
In VB6 you have the callbyname function.

CallByName(object, procedurename, calltype,[arguments()])

Combined with late binding [Set myob = CreateObject("Excel.Sheet")], you may be able to do what you want.

0
 
LVL 1

Author Comment

by:ssite
ID: 1469254
EXCELLENT COGNITION. Send me an e-mail to ssite@netvision.net.il for a little chat :-)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

726 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