Excel friends,
I have the code below that works great in mi local desktop PC. How should I modify it to do exactly the same but the file users.xml should be located in a website as http://www.example.com/users.xml with userID=XYX and Password=123456:
Sub XMLtoExcel()
Dim xml_doc As New DOMDocument
Dim USERDOC As Boolean
Dim onode As IXMLDOMElement, RecordCounter
Dim Sht As Worksheet
USERDOC = xml_doc.Load("C:\users.xml")
Set Sht = ThisWorkbook.Worksheets("Sheet1")
RecordCounter = 2
If USERDOC Then
With Sht
For Each onode In xml_doc.SelectNodes("//Row")
.Cells(RecordCounter,1) = onode.getAttribute("a")
RecordCounter = RecordCounter + 1
Next
End With
Else
MsgBox "Cannot open XML File"
End If
End Sub
A reference to Microsoft XML 6 must be selected.
Any help is appreciated.
Thanks!
I have the code below that works great in mi local desktop PC. How should I modify it to do exactly the same but the file users.xml should be located in a website as http://www.example.com/users.xml with userID=XYX and Password=123456:
Sub XMLtoExcel()
Dim xml_doc As New DOMDocument
Dim USERDOC As Boolean
Dim onode As IXMLDOMElement, RecordCounter
Dim Sht As Worksheet
USERDOC = xml_doc.Load("C:\users.xml")
Set Sht = ThisWorkbook.Worksheets("Sheet1")
RecordCounter = 2
If USERDOC Then
With Sht
For Each onode In xml_doc.SelectNodes("//Row")
.Cells(RecordCounter,1) = onode.getAttribute("a")
RecordCounter = RecordCounter + 1
Next
End With
Else
MsgBox "Cannot open XML File"
End If
End Sub
A reference to Microsoft XML 6 must be selected.
Any help is appreciated.
Thanks!