Good Day Richard When testing my VBA code at the end of lesson 7 I found that if the MsgAttach1 and MsgAttach2 were blank I would get an error message. After some thought I decided that as we were now using a button to select the file to attach the dir code lines were no longer relevant. So have deleted:
If Dir(MsgAttach1) = "" Then MsgBox "Attachment 1 does not Exist" Else OMsg.Attachments.Add (MsgAttach1) End If
and replaced it with
If Not IsNull(MsgAttach1) Then OMsg.Attachments.Add (MsgAttach1) End If
I'd appreciate your thoughts and any suggestions for improved code.
I'm appreciating the seminar and slowly learning VBA code. Great stuff.
Best regards Richard (Melbourne, Aust)
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.