littlelegs
MIS
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...
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...