reza_doang
Board Regular
- Joined
- May 31, 2010
- Messages
- 187
Hi -
I get VBA macro to copy data in worksheet to email body from rondebruin.
But the code only copy the data and table without charts. Is there any way to copy all the data including charts?
Thanks
Reza
I get VBA macro to copy data in worksheet to email body from rondebruin.
But the code only copy the data and table without charts. Is there any way to copy all the data including charts?
Code:
Sub Mail_Sheet_Outlook_Body()'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
'Don't forget to copy the function RangetoHTML in the module.
'Working in Excel 2000-2013
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set rng = Nothing
'Set rng = ActiveSheet.UsedRange
'You can also use a sheet name
Set rng = Sheets("Sheet1").UsedRange
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "reza@xxxxxxx.com"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.HTMLBody = RangetoHTML(rng)
'.Send 'or use
.Display
End With
On Error GoTo 0
Thanks
Reza