Microsoft Excel - Macro check website is active or not in a excel list

Asked By mex on 08-Nov-10 05:33 PM
HI!!! First thnks in advanced...the problem that I have nowadays is that I started working wiht Macros recntly...I have a task based on checking from a list of 1700 websites that strats in cell D2 which ones are currently wroking and which ones don't. I would be really interested in knowing if there is any possible solution trhough Macros in Excel

THANK YOU SO MUCH GUYS!!!

You help me a lot with so many different kind of stuff in other people's posts and finally I am asking you some quesiton...so exciting...xd

BTW: which would be the ebst way for starting in macros and

You could use MSXML parser that comes with IE

Robbe Morris replied to mex on 08-Nov-10 10:57 PM

VBA code.


Function CheckWebSite(url)

 
    Dim oXMLHttp
    Dim resp

    Set oXMLHttp = CreateObject("MSXML2.ServerXMLHTTP.4.0")
   
    oXMLHttp.open "GET", url, false
    oXMLHttp.send()         

    if oXMLHttp.status = 200 Then 
      MsgBox oXMLHttp.responseText   ' Retrieve from server.
   else
     MsgBox "Could not get html."
   end if

   set oXMLHttp = nothing

  end function