Jerry Stuckle Messages: 2598 Registered: September 2010
Karma: 0
Senior Member
On 2/1/2013 6:57 AM, Sonu Yadav wrote:
> Hello friends
>
> I want to write program for get data from website pages..and it will be download in Excel format..How it is possible please help me..
>
Depending on the web page, it's possible. What have you tried?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex(at)attglobal(dot)net
==================
On Feb 1, 5:57 am, Sonu Yadav <sonnu.ya...@gmail.com> wrote:
> Hello friends
>
> I want to write program for get data from website pages..and it will be download in Excel format..How it is possible please help me..
This could be a vba question...
An example:
On Error Resume Next
Dim oHTTP As XMLHTTP: Set oHTTP = CreateObject("Microsoft.XMLHTTP")
If Err = ERR_APP_NOTFOUND Then
MsgBox "Failed CreateObject(""Microsoft.XMLHTTP"")"
GoTo LABEL_GETHTML_EXIT
End If
url = url & "?killcache=" & """" & randomTime & """" 'kill the
cache
If roach = True Or view_link_data = True Then
MsgBox url, , "Link Update Data"
End If
oHTTP.Open "GET", url, False
oHTTP.Send
On Error GoTo 0
Const HTTP_STATUS_COMPLETED As Integer = 200
If oHTTP.status <> HTTP_STATUS_COMPLETED Then
MsgBox "XMLHTTP failed. Status " & oHTTP.status
GoTo LABEL_GETHTML_EXIT
End If
If roach = True Or view_link_data = True Then
MsgBox oHTTP.responsetext, , "Link Update Data"
End If
'Set getHTML = CreateObject("DOMDocument60") ' why not?
Set getHTML = New DOMDocument60
If Err = ERR_APP_NOTFOUND Then
MsgBox "Failed: CreateObject(""DOMDocument60""). Include a
reference to ""Microsoft XML, V6.0"""
GoTo LABEL_GETHTML_EXIT
End If
getHTML.LoadXML (oHTTP.responsetext)
If getHTML.parseError.ErrorCode <> 0 Then
MsgBox "Failed oDoc.LoadXML"
Set getHTML = Nothing
GoTo LABEL_GETHTML_EXIT
End If