Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move to next if path not found

Status
Not open for further replies.

gybjw

Technical User
Oct 28, 2003
1
GB
Hi can anyone help? I have the following line of code that looks up files with various different paths then emails them.

varAttach(x - 1) = Email("Path") & " " & Email("Account name") & " " & Email("Account Number" & x) & " September 2003.xls"
End If
Next x
x = 0

Call SendNotesMail("Summary Information ", varAttach, varpeeps, "Please see the attached" & Chr(13) & Chr(13) & "If you have any queries please contact:" & Chr(13) & "xxxxxx" & Chr(13) & "xxxxxx" & Chr(13) & "Telephone : 0116 2565665" & Chr(13))
Email.MoveNext

Problem is some files aren't generated every month and therefore not there. I need to know a line of code that will ignore the fact that the file isn't there and will continue on with the loop instead of giving an error message each time it can't find a file.
 
IF DIR(pathname) <> &quot;&quot; Then continue processing else move to next record may work?
 
Can't you just use &quot;On Error Resume Next&quot; before your loop ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top