Run-time error "Method "Add" of object "Attachments" failed"

Jyggalag

Active Member
Joined
Mar 8, 2021
Messages
445
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Dear all,

I am trying to run a macro that sends out emails, however when I try to run it I keep getting this error unfortunately:

1642683535626.png


Can somebody please help me figure out why? I have tried setting source = ThisWorkbook.FullName (takes the current excel file I am typing in as an attachment) before and then typing EmailItem.Attachments.Add Source with no issues.

For some reason this gives me an error now with the debug highlighting EmailItem.Attachments.Add Source

Can somebody figure out why?

Would be immensely greatful!

Kind regards
Jyggalag
 
If you add Msgbox Source before that line does it show the correct path?
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
UPDATE: I Believe the error was that I had a & _ at the end of my body code for the email without any text coming after!!

Apologies @RoryA and thank you so very much for your help!! :)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top