LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 190
Default validate url

hi,

i have the following:

Function IsLink(url)
Dim http As Object
Dim xmlhttp As Object

Set http = CreateObject("MSXML2.ServerXMLHTTP.4.0")
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")

On Error Resume Next



xmlhttp.Open "GET", url, False
'This alternative can return status 405 in some cases
'xmlhttp.Open "HEAD", url, False
xmlhttp.Send ""

'You can get the status of the page, if you wish
Status = xmlhttp.Status

If Err.Number < 0 Or Status < 200 Then
IsLink = False
Else
IsLink = True
End If

Set xmlhttp = Nothing

then i have:

Sub L()

IsLink ("HTTP://www.microsoft.com/en/us/default.aspx")

MsgBox Status

End Sub

am i doing something wrong? because i know the website exists, and it
should be returning TRUE.

thanks in advance,
geebee

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
validate wAYNE Excel Discussion (Misc queries) 1 March 1st 10 06:21 PM
validate delmac Excel Programming 0 December 18th 06 08:58 AM
Looking up a name and then being able to validate it twynsys Excel Worksheet Functions 0 November 29th 06 02:48 PM
Looking up a name and then being able to validate it twynsys via OfficeKB.com Excel Worksheet Functions 0 November 21st 06 04:43 PM
VALIDATE WB NAME AD108 Excel Programming 5 July 1st 06 05:55 AM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"