You can use the function below to check if the file exists before proceeding
i.e.
IF Not FileExists(strCompletePath & strAttachmentFile) then
Name strAttachmentPath & strAttachmentFile As strCompletePath & strAttachmentFile
End If
Public Function FileExists(filespec) As Boolean
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(filespec) Then
FileExists = True
Else
FileExists = False
End If
lbl_Exit:
Exit Function
End Function
You changes also show why the other code didn't work.
The macro was written to pass parameters to it i.e.
Sub SendMessage(Optional strAttachmentPath As String, Optional strCompletePath As String)
Even though the parameters are optional, you still have to call it from another process. Your second version eliminates those parameters so can be run directly, but you should change the lines
'// Attachment Path
If strAttachmentPath = "" Then strAttachmentPath = "C:\Reports\"
'// Completed Path
If strCompletePath = "" Then strAttachmentPath = "C:\Complete\"
to
strAttachmentPath = "C:\Reports\"
strCompletePath = "C:\Complete\"
as there is no need for the error trap