Search code examples
excelvbasyntaxactive-directorylate-binding

VBA Late Binding for Active DS Type Library


EDIT: What I have researched on the Active DS Type Library, the examples either require early binding or GetObject. Can late binding be performed on the Active DS Type library using the CreateObject or does it require GetObject? If it can be called using CreateObject, what is the syntax of the “appname.objecttype” inside?

ORIGINAL: I can't seem to find any info on this so I thought I would ask if anyone has a VBA (or similar code) example of using late binding to Active DS Type Library?

What goes inside CreateObject(<Active DS Syntax here>)?


Solution

  • You don't need CreateObject.

    For example to bind a user to an object you can just

    Set usr = GetObject("LDAP://CN=jeffsmith,CN=users,DC=fabrikam,DC=com") 
    

    that's all. For more info see the documentation of the GetObject function.