Share via

runtime error .Attachments.Add (path & fname & ".pdf")

Anonymous
2023-10-20T10:46:15+00:00

Hi there very new to the vba codes i keep getting a debug error the it goes yello i click something then it goes red.... dont know what to do i have put codes on other sheets and they have worked but this one does not....

runtime error

.Attachments.Add (path & fname & ".pdf")

Sub emailMONIpdf()

Dim eapp As Object

Set eapp = CreateObject("outlook.application")

Dim Eitem As Object

Set Eitem = eapp.createitem(0)

Qouteno = Range("C16")

compname = Range("C13")

Subject = Range("C19")

Salesrep = Range("C53")

Cellno = Range("C54")

path = "C:\Users\User\Desktop\I-Secure\QuoteIsecure\Monthly Monitoring"

fname = Subject & " - " & compname

With Eitem

.to = Range("C17") 

.cc = Range("c53") 

.Subject = " Monthly Monitoring Isecure " & compname 

.Body = "Please find Quotation Attached." \_ 

& vbCrLf \_ 

& vbCrLf \_ 

& "Yours Sincerly " \_ 

& vbCrLf \_ 

& " Jaco Coetzee " \_ 

& vbCrLf \_ 

& " 082" \_ 

.Attachments.Add (path & fname & ".pdf") 

 .display 

End With

End Sub

please can some one please help me

its somethng very stupid but i dont know what

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Rory Archibald 18,965 Reputation points Volunteer Moderator
    2023-10-20T10:50:04+00:00

    What is the actual error message?

    Was this answer helpful?

    0 comments No comments