Frage

does anyone know a way simmilar to TypeName() to get the name of the object? For example:

Dim obj
Set obj = GetObject("ADODB.Connection")
Debug.Print ObjectType(obj)

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:

Dim obj
Set obj = GetObject("LDAP://" & DN)
Debug.Print ObjectType(obj)

the reason for all of this is so that i can get rid of all:

Dim a as object
Type of statement.

War es hilfreich?

Lösung

I assume that you have moved on as this thread is old, but as someone who stumbled upon this while searching for and answer to the same question I figured I'd post an answer for the next person.

the reference you need to add is Active DS Type Library and if you are searching for user info the object type is ActiveDs.IADsUser.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top