I'm studying for the GRE and want to make a flash card macro in excel with a list of vocab words. I found this article, but it seems dated and didn't work for me (I don't think that url works anymore). Here's what I've got so far as I try to build up to a function:
But the HTTP request status comes back as "403 - Forbidden". Can anyone help with just this issue before I can move on to trying to parse through all the text?
Code:
Sub DefineWord()
'Assemble HTTP Request
Dim url As String
Dim WinHttpRequest As Variant
Set WinHttpRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
'Get the definition from Google's online dictionary:
url = "https://www.google.com/search?q=Dictionary#dobs=abandon"
WinHttpRequest.Open "GET", url, False
'Send the HTTP Request
WinHttpRequest.send
'Print status to the immediate window
Debug.Print WinHttpRequest.Status & " - " & WinHttpRequest.StatusText
'Get the definition
Dim myDefinition As String
myDefinition = StrConv(WinHttpRequest.responsebody, vbUnicode)
End Sub
Last edited: