Results 1 to 7 of 7

Thread: Object Creation through a string value

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Ontario, Canada
    Posts
    79

    Question

    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!!!


  2. #2

  3. #3
    Guest
    You can however, you can If...Then statement to do a work around.
    Code:
    If sStringVar = "cMerun" Then Dim oObject as New cMerun

  4. #4
    Guest
    C'est possible!

    It's possible.

    Code:
    Dim objObj As Object
    Set objObj = CreateObject(String)
    Gurus. What happened to your knowledge?

  5. #5
    Guest
    But don't forget it has to be a fully qualified object reference eg:

    Code:
        Set objTemp - CreateObject("OCXName.ProgID")
    - gaffa

  6. #6
    Guest
    Yeah, but at least it's a possibility. You can use DLLs and EXEs, too.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Ontario, Canada
    Posts
    79
    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?!?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width