Sub XMLDosyasiniOku_HD()
'Haluk
'06/08/2018 - 13/05/2019
'
Dim XDoc As Object, strURL As String
Dim myList As Object
Dim Num As Byte
Range("A2:G100") = ""
Set XDoc = CreateObject("MSXML2.DOMDocument")
XDoc.async = False
XDoc.validateOnParse = False
strURL = "http://www.tcmb.gov.tr/kurlar/today.xml"
XDoc.Load strURL
'Set myList = XDoc.SelectNodes("//Currency") HEPSİNİ LİSTELEMEK İÇİN
Set myList = XDoc.SelectNodes("//Currency[CurrencyName='US DOLLAR' or CurrencyName='JAPENESE YEN' or CurrencyName='SWISS FRANK']")
If myList.Length = 0 Then GoTo SafeExit:
Num = myList.Length - 1
For i = 0 To Num
Cells(i + 2, 1) = i + 1
Cells(i + 2, 2) = myList(i).ChildNodes(0).Text
Cells(i + 2, 3) = myList(i).ChildNodes(1).Text
Cells(i + 2, 4) = myList(i).ChildNodes(3).Text
Cells(i + 2, 5) = myList(i).ChildNodes(4).Text
Cells(i + 2, 6) = myList(i).ChildNodes(5).Text
Cells(i + 2, 7) = myList(i).ChildNodes(6).Text
Next
SafeExit:
Set myList = Nothing
Set XDoc = Nothing
MsgBox "bitti"
End Sub