title: How can I evaluate a string into an object in VBA?
body: <p>In my previous question, <a href="https://stackoverflow.com/questions/1744216/how-do-i-assign-a-value-to-a-property-where-the-property-name-is-supplied-at-runt">How do I assign a value to a property where the property name is supplied at runtime in VBA?</a>, I learned to use CallByName to set a property in a class at run time.</p>
  
  <p>This time, however, I'm trying to figure out how to get an object at run time from a string.</p>
  
  <p>For example, let's say I have a string with the following data: <code>Worksheets("RAW DATA").Range("A1").QueryTable</code>.</p>
  
  <p>Here's what I might try to do where the data above is the input for <code>strParam</code> below:</p>
  
  <pre><code>Function GetObject(strParam As String) As Object
      GetObject = SomeFunction(strParam)
  End Function
  </code></pre>
  
  <p>In this case, GetObject should return a QueryTable when evaluated against <code>Worksheets("RAW DATA").Range("A1").QueryTable</code>. Is there anything in VBA that could take the place of <code>SomeFunction</code> from the example above?</p>