こんど、ちゃんとまとめるけど、自分へのメモって言うかんじで、
VBAのソースだけ、とりあえず。。
Sub main() Dim doc As Object Dim nodelist As Object Set doc = serverGetAccess("http://dailynews.yahoo.co.jp/fc/domestic/rss.xml") Set nodelist = doc.getElementsByTagName("item") ActiveSheet.Range("A1") = nodelist.Length End Sub Function serverGetAccess(target_url As String) As Object On Error GoTo err Dim httpObj Set httpObj = CreateObject("Microsoft.XMLHTTP") httpObj.Open "GET", target_url, False httpObj.send ("") Set serverGetAccess = httpObj.ResponseXML Exit Function err: Set serverGetAccess = CreateObject("MSXML2.DOMDocument") End Function |
いま、ちょとかいただけなんで、おかしいとことか、バグとかあるかもしれないけど。。
あくまでも、メモってことで。。