Hi
I’ve had a few attempts at this today without success.
The following code transfers files successfully but I need to add a command to check if a folder exists before the files are transferred.
If it’s not, then create one.
The folder created should represent strRef, so if strRef is 12345 then the path should be “ConsoleFiles12345”
I think I need to use FileSystemObject but would this need to open a session to the server to check if the folder exists?
Here’s what I have ( no reference to FileSystemObject) in raw format.
Can anyone help?
Select Case List1
Case “123 Leek”
strRef = InputBox(“Please Enter A Leek Job Number”, “”)
If strRef = “” Then
MsgBox “You Must Enter A Leek Job Number Before Proceeding”, vbInformation, “Reference Error”
Exit Sub
End If
If Len(strRef) > 5 Then
MsgBox “Too Many Characters” & vbCrLf & _
“You Can Only Use 5 Characters” & vbCrLf & _
“Please Enter A Valid 5 Character Number”, vbInformation, “Information”: Exit Sub
End If
If Len(strRef) < 5 Then
MsgBox "Not Enough Characters" & vbCrLf & _
"You Need To Use 5 Characters" & vbCrLf & _
"Please Enter A Valid 5 Character Number", vbInformation, "Information": Exit Sub
End If
For N = 0 To List2.ListCount – 1
FTPSource = "L:MmpdfConsoleFiles" & Left(List2.List(N), 5) & ""
FTPPath = "ConsoleFiles"
FF = Right(List2.List(N), 7)
frmFTP1024.FTPFile "SERVER", "PUT", "USER", "PASSWORD", FTPSource & List2.List(N), FTPPath & strRef & FF
Next N