• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Email my Dashboard using Outlook with all Charts/shapes in it.

Hi All,


I have designed a dashboard with shapes and graphs in it.

Functionality:

We get an incident file on daily basis which is used to refresh the dashboard.
I have put a button which will automatically browse the file and accordingly refresh the graphs.


What I want?
I want my dashboard to send via email using outlook.

Subject:
India MTaaS Dashboard "current date".
Body: Full Dashboard (only)
Attachment: Incident file ("SharedTool_IM_Report.xls")
Recipients: only BCC

Challenges:
I have used many ways shared by http://www.rondebruin.nl/win/s1/outlook/mail.htm but had no luck.

I have used MS Excel 2013 while working on the dashboard.

Please help me out guys I have tried everything I can do with my little knowledge.

Please refer to the files attached. Do let me know if any further clarification is required.
 

Attachments

  • Sample_Dashboard.zip
    421 KB · Views: 102
The link you provided already has the solution (example 1).

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

Should work as long as you added in the Outlook Reference in VBA:

Developer Tab > Visual Basic > Tools > References >

View attachment 22673
I think you have not got my query.

I don't want to send the workbook instead I need to copy all contents in Dashboard sheet and paste it in Outlook mail body.

When I use the standard "Selection.Copy" syntax of VBA it copies all except Shapes and Charts(the most important things).

I also refered to http://www.rondebruin.nl/win/s1/outlook/amail7.htm but unable to implement it for my requirment.

I hope I am clear now :)
 
Dear Ali
Could you help with this topic Email my Dashboard using Outlook with all Charts/shapes in it?

I found it very interesting and would like to apply it on my dashboard production , pdoeria you share with me to where you could do?

Best Regards,

Nildo from Brazil
 
Check this....

Code:
Sub send_mail_chart()
Dim path As String: path = "C:\Users\dEEPAK\Desktop\"
Dim chrt As String: chrt = "chrt1.jpg"

Sheet1.Range("B$1:$U$66").CopyPicture xlScreen, xlBitmap
Application.DisplayAlerts = False
Application.ScreenUpdating = False

With Charts.Add
    .Paste
    .Export Filename:=path & chrt, Filtername:="JPG"
    .Delete
End With
   
    With CreateObject("Outlook.Application").CreateItem(0)
        .To = ""
        .CC = ""
        .BCC = ""
        .Subject = "India MTaaS Dashboard " & Date
      '  .Attachments "x"
        .Attachments.Add path & chrt, olByValue, 0
        .HTMLBody = .HTMLBody & "<img src='cid:" & chrt & "'><br>"
        .Display
    End With
   
Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub
 
Check this....

Code:
Sub send_mail_chart()
Dim path As String: path = "C:\Users\dEEPAK\Desktop\"
Dim chrt As String: chrt = "chrt1.jpg"

Sheet1.Range("B$1:$U$66").CopyPicture xlScreen, xlBitmap
Application.DisplayAlerts = False
Application.ScreenUpdating = False

With Charts.Add
    .Paste
    .Export Filename:=path & chrt, Filtername:="JPG"
    .Delete
End With
  
    With CreateObject("Outlook.Application").CreateItem(0)
        .To = ""
        .CC = ""
        .BCC = ""
        .Subject = "India MTaaS Dashboard " & Date
      '  .Attachments "x"
        .Attachments.Add path & chrt, olByValue, 0
        .HTMLBody = .HTMLBody & "<img src='cid:" & chrt & "'><br>"
        .Display
    End With
  
Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub
Hi Deepak I have a little doubt for your code, will it work if I have multiple charts and images on my range.

Please refer to the attached screenshot of my dashboard which I want to send pasted as Picture in email body.

dashboardPNG.png
 

Attachments

  • dashboardPNG.png
    dashboardPNG.png
    198.8 KB · Views: 14
Back
Top