LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
Jim Cone
 
Posts: n/a
Default How to check if a file exists in an ftp folder

Well, I am still ignorant, but give one or both of these a try
and see what happens.
Replace the file path shown in the function calls with the
correct file path.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


Sub CallFirstFunction()
Call FindFile("C:\Documents and Settings\user\My Documents\File Name.xls")
End Sub

Function FindFile(ByRef strPath As String)
Dim strFile As String
strFile = Dir(strPath)
If Len(strFile) Then
MsgBox "File Exists"
Else
MsgBox "File does not exist"
End If
End Function
'------------------

Sub CallSecondFunction()
MsgBox ReportFileStatus("C:\Documents and Settings\user\My Documents\File Name.xls")
End Sub

Function ReportFileStatus(filespec)
Dim fso As Object
Dim msg As String
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
msg = filespec & " exists. "
Else
msg = filespec & " doesn't exist. "
End If
ReportFileStatus = msg
Set fso = Nothing
End Function
'-----------------------------------



"LL Cool A"

wrote in message
Yes, I will know the file path. The folder is located on an ftp site.

"Jim Cone" wrote:
Will you know the file path when the code is run?
What is an ftp folder?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"LL Cool A"
wrote in message
Hi all,
Do any of you guys (and gals) know how to check via vb if a file in an ftp
folder exists?
Thanks.

 
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
Need code to save file to new folder, erase from old folder Ron M. Excel Discussion (Misc queries) 1 February 24th 06 06:02 PM
Excel should open documents in the folder of the current file boxfactory Setting up and Configuration of Excel 0 October 20th 05 03:35 PM
Check if a number exists in a range? gkaste Excel Discussion (Misc queries) 2 July 13th 05 08:00 PM
templates on network drive maryj Excel Discussion (Misc queries) 15 June 27th 05 10:28 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


All times are GMT +1. The time now is 05:30 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"