Thread: validate url
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default validate url

You may be able to get filename by using a FTP command. Try it manually
first to see if it works. For example. Not all websites allow FTP access or
require a password to get access. Some have Annoymous account where the user
name is iether FTP or Annoymous. Usual pasword for Anoymous accounts are FTP
or nothing. Some sittes give messages to tell you the password. See example
of Microsofts FTP account below. The DIR command will give you a list of
files in a directory. changing directories is equivalent to changing
directories on a PC. Each forwarrd slash is a subdirectory.


1) Open FTP from start button - Start - Run - FTP
2) Enter URL
type Open <CR
to: FTP.microsoft.com
User <ftp.microsoft.com:<none: FTP <cr
Annoyymous access allowed, send identity (e-mail name) as password
Password: Enter your e-mail address
Annoymous user logged in
ftpdir

You can use the following commands in FTP

HELP - gives list of all command
DIR - lists of files in directory
CD - Change directory
DIR - List file names

"geebee" wrote:

ok thanks..taking it a step further now...
i have the following:

With myIE
.navigate
"https://webaddressdotcom/secure/Save=/Sites/46/Reports/5005_46_16_AppServiceUser_20080918200557769_ZZ-2DRLSD-20CH-20SENT.pdf"
...

i would like to know if there is a way i can have something like :
.navigate
"https://webaddressdotcom/secure/Save=/Sites/46/Reports/5005_46_16_AppServiceUser_20080918" & %(like 0 to 10) & "_ZZ-2DRLSD-20CH-20SENT.pdf"

just in case i do not know the exact URL?

or is there any way i can LOOP through numbers/possibilities to arrive at
the "200557769" part which comes before the "_ZZ?

thanks in advance,
geebee


"Joel" wrote:

Remove the ON ERROR statement and try again. Your code is failing and you
don't know it.

"geebee" wrote:

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