Function GetCookie(strUrl) Dim web, strCookie On Error Resume Next Set web = Nothing Set web = CreateObject("WinHttp.WinHttpRequest.5.1") If web Is Nothing Then Set web = CreateObject("WinHttp.WinHttpRequest") If web Is Nothing Then Set web = CreateObject("MSXML2.ServerXMLHTTP") If web Is Nothing Then Set web = CreateObject("Microsoft.XMLHTTP") web.Open "GET", strUrl, False web.SetRequestHeader "REFERER", strUrl web.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" web.SetRequestHeader "Accept", "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" web.SetRequestHeader "Accept-Language", "en-us,en;q=0.5" web.SetRequestHeader "Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7" web.Send strCookie = web.getResponseHeader("Set-Cookie") strCookie = Split(strCookie, ";")(0) GetCookie = strCookie End Function