title: VBA get object type and library for LDAP
body: <p>does anyone know a way simmilar to TypeName() to get the name of the object? For example:</p>
  
  <pre><code>Dim obj
  Set obj = GetObject("ADODB.Connection")
  Debug.Print ObjectType(obj)
  </code></pre>
  
  <p>I would like this to print out "ADODB.Connection" rather than "Object" like TypeName(). This is a simplified version of the problem, I would most likely do something like:</p>
  
  <pre><code>Dim obj
  Set obj = GetObject("LDAP://" &amp; DN)
  Debug.Print ObjectType(obj)
  </code></pre>
  
  <p>the reason for all of this is so that i can get rid of all:<pre>Dim a as object</pre>Type of statement.</p>