Skip to content

Instantly share code, notes, and snippets.

@remoharsono
Created August 28, 2014 05:51
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save remoharsono/2a90bfb67c31fc68cfd3 to your computer and use it in GitHub Desktop.
Save remoharsono/2a90bfb67c31fc68cfd3 to your computer and use it in GitHub Desktop.
Using Excel VBA to Send HTTP GET Request to Web Server
Private Sub cmdKirimGET_Click()
Dim strResult As String
Dim objHTTP As Object
Dim URL As String
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
URL = "http://localhost/search.php"
objHTTP.Open "GET", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHTTP.send ("keyword=php")
strResult = objHTTP.responseText
Worksheets("Sheet1").Range("A10:A10") = strResult
End Sub
@AhmedBermo
Copy link

what does objHTTP.send ("keyword=php") do?

@alisonjr
Copy link

alisonjr commented Feb 1, 2023

thanks!! 🎉🎉🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment