I am trying to write a query to pull information listed in an Excel Spreadsheet (2003). It runs for a bit, then give me the error:
Run-time error '438' - Object does not support this property or method.
I can reset the code to start from a different line and it runs a bit and errors again - it seems to run a different amount each time.
The code is below - any help is appreciated.
Sub TSHomeDirectory()
Dim mycmd As String
Dim UserIn As String
Dim Objuser
For x = 1 To 13729
Set Objuser = GetObject("LDAP://" & Sheet1.Range("B" & x).Value)
Objuser.GetInfo
Range("C" & x).Value = Objuser.TerminalServicesHo
meDirector
y
x = x + 1
Set Objuser = GetObject("LDAP://" & Sheet1.Range("B" & x).Value)
'Loop
Next
End Sub
Start Free Trial