Sub Open_Window_To_Pick()
Dim f As Object
Set f = Application.FileDialog(3)
f.InitialFileName = "Q:\rambo\future.rent\"
f.AllowMultiSelect = True
If f.Show Then
For i = 1 To f.SelectedItems.Count
sFile = Filename(f.SelectedItems(i), sPath)
'MsgBox sPath & sFile
'Copy and Rename File
FileToBeCopied = sPath & sFile
MatchFileToBeCopied = Left(sFile, 23)
If MatchFileToBeCopied = "FUTURE.RENT.LIFT.REJECT" Then
FileToBeExported = "S:\FinAdj\Master_Files\PAID_AHEAD\PARIS.TXT"
FileCopy FileToBeCopied, FileToBeExported
MsgBox "PARIS: The file " & file & " was loaded successfully."
Else
MsgBox "PARIS: The file " & file & " does not match the correct file FUTURE.RENT.LIFT.REJECT."
End If
Exit Sub
Next
End If
End Sub
Public Function Filename(ByVal strPath As String, sPath) As String
sPath = Left(strPath, InStrRev(strPath, "\"))
Filename = Mid(strPath, InStrRev(strPath, "\") + 1)
End Function