So using the Code you Gave did in fact give me more a less the desired results, however right now I'm erroring out at this line at Sheets3 D58
rng.Offset(0, 3).Value = nodes(nd + 1).Attributes(0).Value 'Lead Role
Here's the code after i manipulated it to get what i could out of it. If i can't pull values from the line, I'd like to just leave the Cell value = ""
Sub PersonsNode()
Dim rngCode As Range
Dim rng As Range
Dim xml As Object
Dim nodes As Object
Dim Noded As Object
Dim strURL As String
Dim arrCat As Variant
Dim PerNode As String
Dim I As Long
Dim j As Long
Dim LastRow As Long
LastRow = Worksheets("Data").Range("A" & Rows.Count).End(xlUp).Row
Set rngCode = Sheets("Data").Range("D3")
Set xml = CreateObject("MSXML2.DOMDocument")
With xml
Set rng = Sheets("sheet2").Range("A2")
For j = 3 To LastRow
Set rngCode = Sheets("Data").Range("D" & j)
If Not rngCode <> "" Then
GoTo 4
Else
strURL = "http://api.themoviedb.org/2.1/Movie.getInfo/en/xml/644c8c7523000ff3de7cf4b0af9d4f8c/" & rngCode.Value
.Load strURL
Do: DoEvents: Loop Until .readyState = 4
Set nodes = .getelementsbytagname("person")
For Each nd In nodes
For Each attr In nd.Attributes
Debug.Print attr.Name & " - " & attr.Value
Next attr
Next nd
On Error GoTo 4
If nodes.Length >= 0 Then
On Error GoTo 4
rng.Offset(0, 0).Value = nodes(nd).Attributes(0).Value 'Lead Role
rng.Offset(0, 1).Value = nodes(nd).Attributes(1).Value 'Starring Role
rng.Offset(0, 2).Value = nodes(nd).Attributes(2).Value 'Position
Else
End If
GoTo 1
1
If nodes.Length >= 0 Then
On Error GoTo 4
rng.Offset(0, 3).Value = nodes(nd + 1).Attributes(0).Value 'Lead Role
rng.Offset(0, 4).Value = nodes(nd + 1).Attributes(1).Value 'Starring Role
rng.Offset(0, 5).Value = nodes(nd + 1).Attributes(2).Value 'Position
Else
End If
GoTo 2
2
If nodes.Length >= 0 Then
On Error GoTo 4
rng.Offset(0, 6).Value = nodes(nd + 2).Attributes(0).Value 'Lead Role
rng.Offset(0, 7).Value = nodes(nd + 2).Attributes(1).Value 'Starring Role
rng.Offset(0, 8).Value = nodes(nd + 2).Attributes(2).Value 'Position
Else
End If
GoTo 3
3
If nodes.Length >= 0 Then
On Error GoTo 4
rng.Offset(0, 9).Value = nodes(nd + 3).Attributes(0).Value 'Lead Role
rng.Offset(0, 10).Value = nodes(nd + 3).Attributes(1).Value 'Starring Role
rng.Offset(0, 11).Value = nodes(nd + 3).Attributes(2).Value 'Position
Else
End If
GoTo 4
4
Set rng = rng.Offset(1)
End If
Next j
End With
Worksheets("Sheet1").Range("A3:D3").EntireColumn.AutoFit
End Sub
Newest WorkBook vs:
MoviesV5.xlsm
Bookmarks