Sending an Email with an Attachment

Viewed 31

I've seen a few posts on how to send an email with an attachment and have modified the code that was posted, however it gives me an error (Object doesn't support this property or method) related to the ".Attachment.Add fName". I have verified that the variable "fName" contains a string with the full path.

Dim fName As String
Dim myLReport As Workbook

Set myLReport = Workbooks(2)

fName = Application.GetSaveAsFilename
myLReport.SaveAs FileName:=fName, FileFormat:=xlOpenXMLWorkbook

Dim OutApp As Object, OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
   With OutMail
       .To = Range("B102")
       .CC = Range("B103")
       .Attachment.Add fName
       .Display
End With
1 Answers

It's .Attachments.Add not .Attachment.Add.

.Attachments.Add fName

Related