Solved

Set statement

Posted on 1998-12-07
2
121 Views
Last Modified: 2010-05-03
Hi,

what is best solution to solve this "problem":
-let's say you have a toolbar with some buttons on it
-let's say you have few  ActiveX DLL's (each of them shows one form... for example)

Now, is there a way to create reference to it with Set <MyObject> = New <ClassName>
where MyObject and ClassName are strings read from pushed button's tag or description field? (for example)
I would like to automate all this, so i don't have  to write too many IF's.
I would like that "Set MyObject = New ClassName"  is build from strings and then executed?
Is there any way to do it? or is there any other better way of doing it?

Thanks already for your answers,
-Peter
0
Comment
Question by:hpet
2 Comments
 
LVL 13

Accepted Solution

by:
Mirkwood earned 50 total points
ID: 1448462
Set myObject = CreateObject ("projname.classname")

Where projname is your project name and classname is your class name.

Similar to
Set myObject =  new projname.classname

0
 
LVL 1

Author Comment

by:hpet
ID: 1448463
Thanks

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

867 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

17 Experts available now in Live!

Get 1:1 Help Now