Excel - WebService Example

here are instructions for launching a webservice from a button in Excel

From Surya
I have the webservice call on a command button in excel. It needs the macro to be enabled.
I am using a button. On button click, I am calling the webservice. Displaying the results in a messagebox. Below is the code. We can format the output and fill in the fields accordingly.

1
2
3
4
5
6
7
Private Sub CommandButton1_Click()
Dim req As New XMLHTTP
req.Open "GET", "http://www.webservicex.net/airport.asmx/getAirportInformationByAirportCode?airportCode=SAC", False
req.send
MsgBox req.responseText
'Sheet1.Range("G5").Cells(1, 1).Value = req.responseText
End Sub