Using Excel VBA To Send HTTP GET Request To Web Server

Skip to content All gists Back to GitHub Sign in Sign up Sign in Sign up Dismiss alert {{ message }}

Instantly share code, notes, and snippets.

@remoharsono remoharsono/Excel VBA - Send GET Request Created August 28, 2014 05:51 Show Gist options
  • Star () You must be signed in to star a gist
  • Fork () You must be signed in to fork a gist
  • Embed Clone this repository at <script src="https://gist.github.com/remoharsono/2a90bfb67c31fc68cfd3.js"></script>
  • Save remoharsono/2a90bfb67c31fc68cfd3 to your computer and use it in GitHub Desktop.
Code Revisions 1 Stars 14 Forks 4 Embed Clone this repository at <script src="https://gist.github.com/remoharsono/2a90bfb67c31fc68cfd3.js"></script> Save remoharsono/2a90bfb67c31fc68cfd3 to your computer and use it in GitHub Desktop. Download ZIP Using Excel VBA to Send HTTP GET Request to Web Server Raw Excel VBA - Send GET Request This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters
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

AhmedBermo commented Dec 10, 2021

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 You can’t perform that action at this time.

Từ khóa » Visual Basic Excel Send Http Request