Microsoft Excel - How to attach just a worksheet to an email and not an entire workbook?

Asked By Greg on 07-Apr-14 11:52 AM
Hello,

I've had difficulty with this for some time.  I have an excel document that has a macro button which copies itself onto and email with code:

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.to = toStr
.CC = ccStr
.BCC = ""
.Subject = "email title" 
.htmlBody = bodyStr
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing

How can i chage this so it only attaches the individual worksheet and not the entire workbook?  The workbook file size is too large?

thanks!

G
Robbe Morris replied to Greg on 07-Apr-14 02:32 PM
Worksheets do not exist outside the construct of a Workbook.  You'd need to create a new workbook and copy that sheet to it.  Or, save the workbook to second copy and remove all of the other worksheets.
Harry Boughen replied to Greg on 07-Apr-14 04:21 PM
Hi Greg
Have a look at this link and it should get you on the right track.

http://www.rondebruin.nl/win/s1/outlook/amail2.htm

Regards
Harry