VBA read XML only works for local XML files

C4NSU

New Member
I was running the following code\[code\] Sub test() 'XML = "C:\R_20130408_1.xml" 'This is local, and works fine XML = "http://www.treasurydirect.gov/xml/R_20130408_1.xml" 'This get nothing for "point" Dim objXML As DOMDocument Dim point As IXMLDOMNode Set objXML = New DOMDocument With objXML .Load XML Set point = .SelectSingleNode("//AuctionAnnouncement/CUSIP") Sheets(1).Cells(2, 2) = point.Text End With End Sub\[/code\]As you can see, if I download this XML from the web, I can get it working, otherwise, objXML will still load, but point will be nothing. Would anybody offer some thoughts on this?Many thanks!Ji
 
Top