-
Does anyone know how to create an object using the contents of a string?
For example:
In an application I create a CLASS called cMerun.
I have a string variable that has the following in it:
sStringVar = "cMerun"
How can I: Dim oObject as New sStringVar (contents being cMerun) and create a new cMerun object?
Thanks!!!
-
That's not possible so far in VB.
-
You can however, you can If...Then statement to do a work around.
Code:
If sStringVar = "cMerun" Then Dim oObject as New cMerun
-
C'est possible!
It's possible.
Code:
Dim objObj As Object
Set objObj = CreateObject(String)
Gurus:(. What happened to your knowledge?
-
But don't forget it has to be a fully qualified object reference eg:
Code:
Set objTemp - CreateObject("OCXName.ProgID")
- gaffa
-
Yeah, but at least it's a possibility. You can use DLLs and EXEs, too.
-
That is good for ActiveX stuff I think, but I don't think that I can create a Class in a class module in that project and instantiate that class using that function. I got an ActiveX component error when I tried. Thanks anyways! Maybe in 7.0?!?