?
Solved

Calling object methods without direct

Posted on 1999-01-18
2
Medium Priority
?
133 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 800 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

764 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