Send excel sheet ( email) through macro with recipient and cc

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Ryan_Bernal

Thread Starter
Joined
Jan 3, 2013
Messages
3
I found this code in this forum.
i want to add recipient as CC or BCC. What is the correct code for that?
Thanks in advance!
Code:
Public Sub email()

Dim SubJ, Recip As String

SubJ = "Enter your suject"
Recip = "[email protected]"


ThisWorkbook.SendMail Recip, SubJ

msgbox "Email Sent"

End Sub
 
Joined
Jun 29, 2012
Messages
518
something like this may work for you - assuming you mean to send from Excel. Please do always include OS and Application system Versions, saves a great deal of time!
.To and the rest draw the email address from specific cells, rather that hard coding it.
You can use something like
.To = ActiveSheet.Cells(1, 1) & ";" & ActiveSheet.Cells(1, 2) & ";" & ActiveSheet.Cells(1, 3)
to add more.
Excellent help here if you search for Excel Outlook vba

Here is some sample code. Good Luck.
Sub SendingSheet()

Dim oMSOutlook As Object
Dim oEmail As Object

Set oMSOutlook = CreateObject("Outlook.Application")
Set oEmail = oMSOutlook.CreateItem(olMailItem)

With oEmail
.To = ActiveSheet.Cells(1, 1)
.CC = ActiveSheet.Cells(2, 1)
.BCC = ActiveSheet.Cells(3, 1)
.Send
End With


Set oMSOutlook = Nothing
Set oEmail = Nothing

End Sub
 
Joined
Apr 17, 2012
Messages
455
As sendmail has limited feature, only way is to create a outlook object as 20_2_Many suggested.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top