Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel LDAP Group member query

Status
Not open for further replies.
Jul 21, 2004
11
0
0
CA
I found a Macro that would find the groups a user belonged to and add them to a comment field. I want to swap it around and provide a group name and have the comment field filled with the members of the group.

I am having problems with this section of code:
*****Start code snippet********
Set objGroup = GetObject(ldapstring)
tempStr = vbNullString
For Each group In objGroup.Member
tempStr = tempStr & Mid(objGroup.Member.Name, InStr(1, objGroup.Member.Name, "=") + 1) & Chr(10)
Next
c.Offset(0, -1).ClearComments
If tempStr <> vbNullString Then
c.Offset(0, -1).AddComment tempStr
c.Offset(0, -1).Comment.Shape.TextFrame.AutoSize = True
End If

****End code snippet*****

On the line building the 'tempstr' variable, I get error 424 'Object required'. I have checked carefully and am fairly confident that no spelling errors are there. When I watch the variables the Group.Member array has the members I expect in it.

Does anyone have an idea of either what needs to be changed for this code or even a better way of doing it?

I do have a small cmd file that executes a 'dsquery' and can write that to an output file but I am unsure of how to bring that in and add it to the comments field.

My thanks in advance for any hints, tips and handy ideas... :)
 


hi,
VB Help said:
vbNullString String having value 0 Not the same as a zero-length string (""); used for calling external procedures
Rather...
Code:
    tempStr = ""

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top