Test for file on server

  • Thread starter Thread starter windsurferLA
  • Start date Start date
W

windsurferLA

I use Excel'97 under WinXP-pro to automatically open a file stored on a
server. The command is:

Workbooks.Open FileName:= _
"ftp://12.34.567.890/public_html/Actions/DownLoad-UploadTest2.xls"

It works find if the file exists, but if not, I get a run time error
1004, and macro stops.

Is there a way to test whether or not the file exists before attempting
to down load the file? The following doesn't work.

If
("'ftp://12.34.567.890/public_html/Actions/DownLoad-UploadTest5.xls'")_
<> "" Then
Workbooks.Open FileName:= _
"ftp://12.34.567.890/public_html/Actions/DownLoad-UploadTest2.xls"
End If
 
Back
Top