![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Attaching Chart to Email?
I have an Excel spreadsheet, and derived from it 5 charts. How can I attach one of the charts to an email to send to someone? (I know how to attach the whole spreadsheet, and the associated charts, but I don't want to send the spreadsheet and the other 4 charts, because they contain data not appropriate to share with the email recipient.) Thanks. -- ---------- CWLee Former slayer of dragons; practice now limited to sacred cows. Believing we should hire for quality, not quotas, and promote for performance, not preferences. |
|
|||
|
Re: Attaching Chart to Email?
Hi CWLee
Try this example http://www.rondebruin.nl/mail/folder2/chart.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "CWLee" <cdubyalee@post.harvard.edu> wrote in message news:e49TyIvvIHA.3760@TK2MSFTNGP04.phx.gbl... > > I have an Excel spreadsheet, and derived from it 5 charts. > How can I attach one of the charts to an email to send to > someone? > > (I know how to attach the whole spreadsheet, and the > associated charts, but I don't want to send the spreadsheet > and the other 4 charts, because they contain data not > appropriate to share with the email recipient.) > > Thanks. > > -- > ---------- > CWLee > Former slayer of dragons; practice now limited to sacred > cows. Believing we should hire for quality, not quotas, and > promote for performance, not preferences. > |
|
|||
|
Re: Attaching Chart to Email?
"Ron de Bruin" <rondebruin@kabelfoon.nl> wrote > Try this example > http://www.rondebruin.nl/mail/folder2/chart.htm Thanks, but I'm too unsophisticated to follow it. You lost me after: Dim OutApp As Object Dim OutMail As Object Dim Fname As String .... Thanks again for responding. Best regards to all. |
|
|||
|
Re: Attaching Chart to Email?
Hi
Change the path if it not exist 'fill in the file path/name of the gif file Fname = "C:\My_Sales1.gif" It will create a gif file in this location and after it send the mail it will delete this file Change the sheet name to the sheet where the chart is and change the name of the chart in this code line ActiveWorkbook.Worksheets("Sheet1").ChartObjects(" Chart 1").Chart.Export _ Filename:=Fname, FilterName:="GIF" Fill in your mail address to test the code .To = "ron@debruin.nl" Now Run the code Sub SaveSend_Embedded_Chart() 'Working in 2000-2007 Dim OutApp As Object Dim OutMail As Object Dim Fname As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) 'fill in the file path/name of the gif file Fname = "C:\My_Sales1.gif" 'if you hold down the CTRL key when you select the chart 'in 2000-2003 you see the name in the name box(formula bar) ActiveWorkbook.Worksheets("Sheet1").ChartObjects(" Chart 1").Chart.Export _ Filename:=Fname, FilterName:="GIF" On Error Resume Next With OutMail .To = "ron@debruin.nl" .CC = "" .BCC = "" .Subject = "This is the Subject line" .Body = "Hi there" .Attachments.Add Fname .Send 'or use .Display End With On Error GoTo 0 Kill Fname Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "CWLee" <cdubyalee@post.harvard.edu> wrote in message news:uENCsj1vIHA.2068@TK2MSFTNGP05.phx.gbl... > > "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote > >> Try this example >> http://www.rondebruin.nl/mail/folder2/chart.htm > > Thanks, but I'm too unsophisticated to follow it. You lost > me after: > > Dim OutApp As Object > Dim OutMail As Object > Dim Fname As String > ... > > Thanks again for responding. > > Best regards to all. > |
|
|||
|
Re: Attaching Chart to Email?
Thanks again. Sorry to say, I am completely unable to understand what you suggest as a way to email a chart from an Excel spreadsheet. I'm sure your technological knowledge is sound, but your manner of presentation is too advanced for me. Thanks again. ==================== "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message news:eYmCto1vIHA.2068@TK2MSFTNGP05.phx.gbl... > Hi > > > Change the path if it not exist > > 'fill in the file path/name of the gif file > Fname = "C:\My_Sales1.gif" > > It will create a gif file in this location and after it > send the mail it will delete this file > > > > Change the sheet name to the sheet where the chart is and > change the name of the chart in this code line > > ActiveWorkbook.Worksheets("Sheet1").ChartObjects(" Chart > 1").Chart.Export _ > Filename:=Fname, FilterName:="GIF" > > > Fill in your mail address to test the code > .To = "ron@debruin.nl" > > > Now Run the code > > > > Sub SaveSend_Embedded_Chart() > 'Working in 2000-2007 > Dim OutApp As Object > Dim OutMail As Object > Dim Fname As String > > Set OutApp = CreateObject("Outlook.Application") > OutApp.Session.Logon > Set OutMail = OutApp.CreateItem(0) > > 'fill in the file path/name of the gif file > Fname = "C:\My_Sales1.gif" > > 'if you hold down the CTRL key when you select the > chart > 'in 2000-2003 you see the name in the name box(formula > bar) > ActiveWorkbook.Worksheets("Sheet1").ChartObjects(" Chart > 1").Chart.Export _ > Filename:=Fname, FilterName:="GIF" > > On Error Resume Next > With OutMail > .To = "ron@debruin.nl" > .CC = "" > .BCC = "" > .Subject = "This is the Subject line" > .Body = "Hi there" > .Attachments.Add Fname > .Send 'or use .Display > End With > On Error GoTo 0 > > Kill Fname > Set OutMail = Nothing > Set OutApp = Nothing > End Sub > > > -- > > Regards Ron de Bruin > http://www.rondebruin.nl/tips.htm > > > "CWLee" <cdubyalee@post.harvard.edu> wrote in message > news:uENCsj1vIHA.2068@TK2MSFTNGP05.phx.gbl... >> >> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote >> >>> Try this example >>> http://www.rondebruin.nl/mail/folder2/chart.htm >> >> Thanks, but I'm too unsophisticated to follow it. You >> lost me after: >> >> Dim OutApp As Object >> Dim OutMail As Object >> Dim Fname As String >> ... >> >> Thanks again for responding. >> >> Best regards to all. |
|
|||
|
Re: Attaching Chart to Email?
If it is your fist macro it is not so easy <g>
Send me your workbook private and tell me which chart you want to send and I will add the code to the workbook for you -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "CWLee" <cdubyalee@post.harvard.edu> wrote in message news:%23fI5H$2vIHA.2188@TK2MSFTNGP04.phx.gbl... > > Thanks again. Sorry to say, I am completely unable to > understand what you suggest as a way to email a chart from > an Excel spreadsheet. I'm sure your technological knowledge > is sound, but your manner of presentation is too advanced > for me. Thanks again. > > ==================== > > "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message > news:eYmCto1vIHA.2068@TK2MSFTNGP05.phx.gbl... >> Hi >> >> >> Change the path if it not exist >> >> 'fill in the file path/name of the gif file >> Fname = "C:\My_Sales1.gif" >> >> It will create a gif file in this location and after it >> send the mail it will delete this file >> >> >> >> Change the sheet name to the sheet where the chart is and >> change the name of the chart in this code line >> >> ActiveWorkbook.Worksheets("Sheet1").ChartObjects(" Chart >> 1").Chart.Export _ >> Filename:=Fname, FilterName:="GIF" >> >> >> Fill in your mail address to test the code >> .To = "ron@debruin.nl" >> >> >> Now Run the code >> >> >> >> Sub SaveSend_Embedded_Chart() >> 'Working in 2000-2007 >> Dim OutApp As Object >> Dim OutMail As Object >> Dim Fname As String >> >> Set OutApp = CreateObject("Outlook.Application") >> OutApp.Session.Logon >> Set OutMail = OutApp.CreateItem(0) >> >> 'fill in the file path/name of the gif file >> Fname = "C:\My_Sales1.gif" >> >> 'if you hold down the CTRL key when you select the >> chart >> 'in 2000-2003 you see the name in the name box(formula >> bar) >> ActiveWorkbook.Worksheets("Sheet1").ChartObjects(" Chart >> 1").Chart.Export _ >> Filename:=Fname, FilterName:="GIF" >> >> On Error Resume Next >> With OutMail >> .To = "ron@debruin.nl" >> .CC = "" >> .BCC = "" >> .Subject = "This is the Subject line" >> .Body = "Hi there" >> .Attachments.Add Fname >> .Send 'or use .Display >> End With >> On Error GoTo 0 >> >> Kill Fname >> Set OutMail = Nothing >> Set OutApp = Nothing >> End Sub >> >> >> -- >> >> Regards Ron de Bruin >> http://www.rondebruin.nl/tips.htm >> >> >> "CWLee" <cdubyalee@post.harvard.edu> wrote in message >> news:uENCsj1vIHA.2068@TK2MSFTNGP05.phx.gbl... >>> >>> "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote >>> >>>> Try this example >>>> http://www.rondebruin.nl/mail/folder2/chart.htm >>> >>> Thanks, but I'm too unsophisticated to follow it. You >>> lost me after: >>> >>> Dim OutApp As Object >>> Dim OutMail As Object >>> Dim Fname As String >>> ... >>> >>> Thanks again for responding. >>> >>> Best regards to all. > |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|