Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub DoStuff()
- Dim currentChart As ChartObject
- Dim counter As Integer
- counter = 1
- For Each currentChart In Sheets("TablesForCharts").ChartObjects
- Select Case counter
- Case 1
- currentChart.Chart.Export "C:\Users\bgyoti01\Desktop\Chart1.png"
- Case 2
- currentChart.Chart.Export "C:\Users\bgyoti01\Desktop\Chart2.png"
- Case 3
- currentChart.Chart.Export "C:\Users\bgyoti01\Desktop\Chart3.png"
- Case 4
- currentChart.Chart.Export "C:\Users\bgyoti01\Desktop\Chart4.png"
- End Select
- counter = counter + 1
- Next currentChart
- Dim OutApp As Object
- Dim OutMail As Object
- Set OutApp = CreateObject("Outlook.Application")
- Set OutMail = OutApp.CreateItem(0)
- With OutMail
- .To = "stefan.yakimov@ingrammicro.com"
- .CC = ""
- .Attachments.Add "C:\Users\bgyoti01\Desktop\Chart1.png", olByValue, 0
- .Attachments.Add "C:\Users\bgyoti01\Desktop\Chart2.png", olByValue, 0
- .Attachments.Add "C:\Users\bgyoti01\Desktop\Chart3.png", olByValue, 0
- .Attachments.Add "C:\Users\bgyoti01\Desktop\Chart4.png", olByValue, 0
- .Subject = "subjecttttttt"
- .HTMLBody = .HTMLBody & "<img src='cid:Chart1.png'" & "<img src='cid:Chart2.png'" & "<br></br>" & "<img src='cid:Chart3.png'" & "<img src='cid:Chart4.png'"
- .Send
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement