Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Add a file using VBA MailEnvelope

$
0
0

Trying to add a file to a mail VBA, but I keep getting an error.

My code:

Sub MAIL()

 ActiveWorkbook.EnvelopeVisible = True
  With ActiveSheet.MailEnvelope
   .Introduction = "Hello,"& vbNewLine & vbNewLine & "Hereby I send you this file."
   .Item.To = "john.doe@gmail.com"
   .Item.Subject = "Daily file"
   .Attachments.Add ("C:\Users\Admin\Desktop\Daily file.pdf")
 End With

End Sub

Error reads:

Run-time error '438': Object doesn't support this property or method

What can I do to get past this?


Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>