Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I Am using the following that I found somewhere to get the members in an
Active Directory group and populate a spreadsheet with the names. Problem is it always returns 1500 names. even if I know there are 1600 people in this group. Is the array limited in size, or is the LDAP query limited in it's return? Thanks Sub ADGroupMembers() Dim arrNames() intSize = 0 'Let's clear the range first Range("SCREEN").ClearContents 'Get the AD Group Info for BATY-SESCREEN Set objGroup = GetObject("LDAP://CN= BATY-SESCREEN,OU=Security Groups,DC=baty,DC=com") 'Getting User Names and increase the array size For Each strUser In objGroup.Member Set objuser = GetObject("LDAP://" & strUser) ReDim Preserve arrNames(intSize) arrNames(intSize) = objuser.CN intSize = intSize + 1 Next 'In order to sort, we have to convert to Uppercase. For i = (UBound(arrNames) - 1) To 0 Step -1 For j = 0 To i If UCase(arrNames(j)) UCase(arrNames(j + 1)) Then strHolder = arrNames(j + 1) arrNames(j + 1) = arrNames(j) arrNames(j) = strHolder End If Next Next 'Fill the SESCREEN range with the array values Range("SESCREEN").Value = WorksheetFunction.Transpose(arrNames) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Limit on array formula | Excel Worksheet Functions | |||
Array size limit | Excel Programming | |||
what is array size limit in VBA? | Excel Programming | |||
Determining Array Limit | Excel Programming | |||
limit to possible array size? | Excel Programming |