View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default need macro for create new email message and send it

Hi Yuvalbra,

i need function to check if exist file name in folder


Try:

'=============
Function FileExists(FileName As String, _
Optional FilePath As String) As Boolean
If Len(FilePath) Then
If Right(FilePath, 1) < "\" Then
FilePath = FilePath & "\"
End If
End If
FileExists = Len(Dir(FilePath & FileName)) 0
End Function
'<<=============


'=============
Public Sub TestIt()
MsgBox FileExists("Test1.xls", "C:\B\AA\AA2\")
End Sub
'<<=============

By the way, it is conventional to open a new thread for distinct question.



---
Regards,
Norman