Sending email using VBA

richanor

Active Member
Joined
Apr 8, 2006
Messages
291
Hi, I am using a bit of code I found on here to send a selected worksheet by email. Below is a snippet of the code:

Code:
    With Dest
        .SaveAs TempFilePath & TempFileName & FileExtStr, _
                FileFormat:=FileFormatNum
        On Error Resume Next
        .SendMail "myemail@domain.com", _
                  "Subject"
        On Error GoTo 0
        .Close SaveChanges:=False
    End With

    Kill TempFilePath & TempFileName & FileExtStr

I wondered if there is any way to tweak the code to add in a second email address, or a cc - as I wanted to sent the sheet to two people at once, but I don't want the user to have to click 'allow' several times. I've tried a few tweaks but none of them have worked - is this possible?

many thanks

Rich
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

richanor

Active Member
Joined
Apr 8, 2006
Messages
291
Hi Andrew

thanks for your reply, and sorry about the delay in responding - I've been away. Your help, as always, is very much appreciated.

Rich
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,029
Messages
5,856,933
Members
431,840
Latest member
simplysoph

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
Top