Tuesday, April 12, 2011

Getting web request with GET request in Excel

I found a cool easy way to do a GET request to any website and use any parameters needed.
One method to get code from a webpage and use it is here:
http://scriptorium.serve-it.nl/view.php?sid=40
and another I use is here:
Function testHttpGet()
Dim oHttp As Object
Set oHttp = CreateObject("Microsoft.XMLHTTP")
MyUrl = "http://10.0.21.130/test.php?name=mikeqq"
oHttp.Open "GET", MyUrl, False
oHttp.send
'MsgBox oHttp.Status
If oHttpPost.Status < 300 Then
SomeVar = oHttpPost.responseText
MsgBox SomeVar
End If
End Function

Just put this code in a module in Excel and then call it from in the spreadsheet somewhere. So now I can have excel give and get commands from a PHP script and could even act like a cron job by executing every once in a while!

4 comments:

gowsalya said...

Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
python Training institute in Pune
python Training institute in Chennai
python Training institute in Bangalore

haripriya said...

Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision. 
Data Science Training in Indira nagar
Data Science training in marathahalli
Data Science Interview questions and answers
Data Science training in btm layout
Data Science Training in BTM Layout
Data science training in kalyan nagar




ragul ragul said...

This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
Microsoft azure training in Bangalore
Power bi training in Chennai

nisha said...

The blog is easily clarify the queries for the beginners. every concept should be very neatly represented.

Data Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery