It seems to largely work here; I got no error 1004, but I did get an error 400 which turns out on my Windows 7, Excel 2010 (32 bit) to be caused by this code (where I have commented out the lines giving trouble):
Code:
With .Cells(1)
'.PasteSpecial Paste:=8 '8 as table
.PasteSpecial xlPasteValues, , False, False
'.PasteSpecial xlPasteFormats, , False, False
.Select
End With
You seem to be missing some of Ron de Bruin's code to attach files to the email; you need to add the following snippet of his just before:
Code:
'Resolve each Recipient's name.
missing lines:
Code:
' Add attachments to the message.
If Not IsMissing(strAttachmentPath) Then
If Len(Dir(strAttachmentPath)) <> 0 Then
Set objOutlookAttach = .Attachments.Add(strAttachmentPath)
Else
MsgBox "Unable to find the specified attachment. Sending mail anyway."
End If
End If
Bookmarks