Ok so here's my delima
I'm pulling info from a web XML, then comparing from the node that matches my base name criteria if that typedvalue and another withing the same node different base name matches the current rows info, if so then pull various data:
any Help as always is appriciated
this is the line that never seems to pass
If rng.Offset(0, 2).Value = .nodeTypedValue Then
Here's the Full Sub:
Sub Get_Episode_ID()
Dim wsSeries As Worksheet
Dim rng As Range
Dim rngCode As Range
Dim xml As Object
Dim nodes As Object
Dim node As Object
Dim x As Long
Dim LastRow As Long
Dim J As Long
Set xml = CreateObject("MSXML2.DOMDocument")
Set wsSeries = Sheets("sheet2") 'Sheets("Series")
LastRow = wsSeries.Range("A" & Rows.Count).End(xlUp).Row
With xml
Set rng = wsSeries.Range("A2")
For J = 2 To LastRow
Set rngCode = wsSeries.Range("G" & J)
If rngCode <> "" Then
.Load "http://thetvdb.com/api/0222EA3F34B90B2C/series/" & rngCode.Value & "/all/en.xml"
'http://thetvdb.com/api/0222EA3F34B90B2C/series/81189/en.xml
Do: DoEvents: Loop Until .ReadyState = 4
If .ChildNodes.Item(1).ChildNodes.Length = 0 Then
MsgBox "No Data"
Exit Sub
Else
Set nodes = .getelementsbytagname("Episode")
For x = 0 To nodes.Length - 1
For Each node In nodes(x).ChildNodes
With node
If node.BaseName = "SeasonNumber" Then
If rng.Offset(0, 2).Value = .nodeTypedValue Then
With node
If node.BaseName = "EpisodeNumber" And .nodeTypedValue = rng.Offset(0, 3) Then
If node.BaseName = "SeasonNumber" Then
rng.Offset(0, 15).Value = .nodeTypedValue
End If
If node.BaseName = "EpisodeNumber" Then
rng.Offset(0, 16).Value = .nodeTypedValue
End If
If node.BaseName = "id" Then
rng.Offset(0, 7).Value = .nodeTypedValue
End If
If node.BaseName = "IMDB_ID" Then
rng.Offset(0, 12).Value = .nodeTypedValue
End If
If node.BaseName = "FirstAired" Then
rng.Offset(0, 13).Value = .nodeTypedValue
End If
If node.BaseName = "Overview" Then
rng.Offset(0, 14).Value = .nodeTypedValue
End If
If node.BaseName = "EpisodeName" Then
rng.Offset(0, 17).Value = .nodeTypedValue
End If
End If
End With
End If
End If
End With
Next node
Next x
End If
End If
1
Set rng = rng.Offset(1)
Next J
End With
End Sub
Here's the XML from the Url:
Here's a portion of the XML: (I'm comparing SeasonNumber with ("C:" & J) and EpisodeNumber with ("D:" & J) but it doesn't go past the first cell value comparison
and last but not least the Workbook: (Code located in Episode_ID_Test Module) and running it against Sheet2 for the moment
Series_XML_V2.xlsm
Bookmarks