View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Capture request/response HTTP headers with VBA

dim c as range

for each c in thisworkbook.sheets("Sheet1").range("A2:A50")
if c.value<"" then c.offset(0,1).value=GetHeader(c.value)
next c

Assuming A2:A50 is a range containing URL's.

--
Tim Williams
Palo Alto, CA


"p3plyr" wrote in message ...
Tim, thanks for taking the time to reply. i really appreciate it!

my vb skills are somewhat limited. can you give me an example of how i can
call on that function you posted so that it will return the data such as i
just posted in the reply to Nick above?

thanks again





"Tim Williams" wrote:

Look for xmlhttp - plenty of code examples online.

Function GetHeader(sURL As String) As String

Dim oXHTTP As Object
Set oXHTTP = CreateObject("MSXML2.XMLHTTP")

oXHTTP.Open "HEAD", sURL, False
oXHTTP.send

GetHeader = oXHTTP.getAllResponseHeaders()

End Function

--
Tim Williams
Palo Alto, CA


"p3plyr" wrote in message ...
hi

was wondering if anyone knows how to do this. there is some code in VB5 that
supposedly gets this information, but it wont work with VBA

http://www.planet-source-code.com/vb...p%2FC117001102

all i need is the code that logs the GET information.

thanks