+ Reply to Thread
Results 1 to 2 of 2

vba select from Active Directory (LDAP)

  1. #1
    WillC
    Guest

    vba select from Active Directory (LDAP)

    I have found references to VBScript that let me create a workbook-spreadsheet
    with a list of computer names from Active Directory. When I take the script
    and put it into a workbook to use as a VBA it fails stating no record
    returned.
    I cannot find any reference for doing an LDAP query from inside Excel, do
    anyone here know where such a reference can be found?

    source: List Active Directory Data in a Spreadsheet
    http://www.microsoft.com/technet/scr.../ofexvb05.mspx
    The part that reports the error is;
    Set objRecordSet = objCommand.Execute
    objRecordSet.MoveFirst <-- this line and the Error code is:
    Run-time error '3021':
    Either BOF or EOF is True, or the current record was deleted. Requested
    operation requires a current record.


    --
    Implement by Design,
    Enhanced by Ability
    - get the IDEA!

  2. #2
    Chris
    Guest

    Re: vba select from Active Directory (LDAP)

    Hi Will,

    I'm just taking a guess here, but maybe you have to add a reference to the
    Microsoft ADO file under the Visual Basic
    Editor-->Tools-->References-->Microsoft ActiveX Data Objects. I also see
    Microsoft ActiveX Data Objects Recordset in there as well, but have no clue
    as to exactly what it's needed for.

    Hope it helps,

    Chris


    "WillC" <[email protected]> wrote in message
    news:[email protected]...
    >I have found references to VBScript that let me create a
    >workbook-spreadsheet
    > with a list of computer names from Active Directory. When I take the
    > script
    > and put it into a workbook to use as a VBA it fails stating no record
    > returned.
    > I cannot find any reference for doing an LDAP query from inside Excel, do
    > anyone here know where such a reference can be found?
    >
    > source: List Active Directory Data in a Spreadsheet
    > http://www.microsoft.com/technet/scr.../ofexvb05.mspx
    > The part that reports the error is;
    > Set objRecordSet = objCommand.Execute
    > objRecordSet.MoveFirst <-- this line and the Error code is:
    > Run-time error '3021':
    > Either BOF or EOF is True, or the current record was deleted. Requested
    > operation requires a current record.
    >
    >
    > --
    > Implement by Design,
    > Enhanced by Ability
    > - get the IDEA!




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1