VBA code to mail to multiple recipients/multiple attachments through Excel

Fillonte

Board Regular
Joined
May 29, 2015
Messages
73
Hi guys,

I have a macro to convert a sheet of my wb into pdf and email it. As long as it's one single sheet and one recipient for the mail, everything works great.

However I can't seem to be able to have the macro:

1) mail the file to multiple recipients;

2) attach to the email more than one file;

Is there a way to do it?

This is the code I'm using for the sending part of the macro

Code:
 MailFromMacWithMail bodycontent:="" & vbNewLine & vbNewLine & "", _
                            mailsubject:="", _
                            toaddress:="", _
                            ccaddress:="", _
                            bccaddress:="", _
                            attachment:=PDFfolder & PDFfileName & ".pdf", _
                            displaymail:=False

I can't manage to add more addresses or attachments no matter what I do (I have no background into coding whatsoever though).

I'm on a Mac using Mail, but if there's no other solution, I could try Outlook (even though I kinda hate it).

Thanks in advance for any help
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I've tried to add

Code:
 Dim myaddress
myaddress = Array("address1@gmail.com", "address2@gmail.com")

and use "myaddress" in "toaddress" line of the mailing code, but I end up getting a"Byref argument type mismatch error".

I'm definitely lost on this.
 
Upvote 0
Anyone with any insight on the issue today?

I'm still totally stuck here and I really need to finish this project.

Thanks in advance
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,772
Members
449,095
Latest member
m_smith_solihull

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