Welcome Guest Search | Active Topics | Log In | Register

Web Page data to Excel worksheet
#1 Posted : 03 January 2011 11:34:30(UTC)
Rank: Administration

Groups: Administrators
Joined: 09/09/2010(UTC)
Posts: 48

Thanks: 0 times
Was thanked: 1 time(s) in 1 post(s)

Public Sub UpdateSheet()
    'Create the xmlhttp object
    Dim xmlhttp
    Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
    'Open a connection and send a request to the server in the form of an XML fragment
    Call xmlhttp.Open("POST", "", False)
    Call xmlhttp.send("<reqtimesheet user='jimbob'/>")
    'Create an xml document object, and load the server's response
    Dim xmldoc
    Set xmldoc = CreateObject("Microsoft.XMLDOM")
    xmldoc.async = False
    'Note: the ResponseXml property parses the server's response, responsetext doesn't
    xmldoc.loadXML (xmlhttp.responseXML)
    'Use the server's information to update the spreadsheet
    'Note: The structure of the XML document is imaginary and arbitrary, of course.
    Worksheets("TimeSheet").Range("A1").Value = xmldoc.documentElement.getAttribute("firstname")
    Worksheets("TimeSheet").Range("B1").Value = xmldoc.documentElement.getAttribute("lastname")
    Worksheets("TimeSheet").Range("C37").Value = xmldoc.documentElement.selectSingleNode("totalhours").Text
End Sub

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

SoClean Theme By Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.072 seconds.