|
Excel Tutorial - Copy Charts To Powerpoint
Video | Similar Helpful Excel Resources
ExcelExperts.com brings you training video on: Excel Tutorial - Copy Charts To Powerpoint
Got a Question? Ask it Here in the Forum.
Similar Helpful Excel Resources
Hi All,
Does anybody know, using VBA, how to copy excel charts (not images) into powerpoint and format the size and location.
Hi!
I have an excel file which creates many charts. I need to repeatedly (every week) copy paste all these graphs in a power point presentation.
Do you know if it is possible to create a macro that does this copy/pasting job?
There should be a formatted powerpoint presentation which gets all charts pasted in and is saved with a different name (containing the date) each time.
Thank you very much for your help!
I'm trying to copy and paste charts and tables from Excel to Powerpoint, but the right-hand edges are being chopped off.
I've tried all the different paste special options, and various view sizes and page breaks but nothing is working.
Any suggestions?
Dear all,
I have been at this but with no success. For eg. I copy a chart or select some highlighted cells and paste special - link to Powerpoint, the link is ok.
However, whenever, I try to send out both the Excel and Powerpoint file to another user or use manual method such as copy and paste (my local drive to memory stick and then to other users local drive), the links does not automatically detect the change in the file location and thus a link update failure.
It is even more fustrating when I need to rename the Excel file.
Does anyone has a better way to manage paste special link
Cheers,
CL
Hello everyone,
I have an excel sheet with 20 charts, these charts are updated from time to time..and have to paste them in a powerpoint presentation.
I need a macro that copy every chart to a specific slide in my powerpoint template.
For example, Chart(1) must be paste in slide2, chart(2) must be paste in slide6 and so on...
I found on another forum a macro code that copies only one chart to one specific slide, I need to modified to copy one by one my charts to the specified slides in powerpoint..
Sub test_paste2()
Dim Sh As Shape
Dim PP As PowerPoint.Application
Dim PPpres As PowerPoint.Presentation
'Create a PP application and make it visible
Set PP = New PowerPoint.Application
PP.Visible = msoCTrue
'Open the presentation you wish to copy to
Set PPpres = PP.Presentations.Open("C:\work\test1.ppt")
'Set the shape you want to copy
Set Sh = Worksheets("Sheet1").Shapes(1)
'Copy the shape
Sh.CopyPicture Appearance:=xlScreen, Format:=xlPicture
'And paste it on the second slide
PPpres.Slides(2).Shapes.Paste
Set Sh = Nothing
Set PP = Nothing
Set PPpres = Nothing
End Sub
If you have an idea how to modify this, to be useful for what I need...
I know that my be simple but I'm new to VBA and don't know how to do it
Thanks in advance
Hi
I have a group of charts on an excel worksheet that I need to copy onto a powerpoint slide. I have 4 charts put together as one group on a sheet which I want to copy to a specific slide of an already running presentation. I am not able to select the group as on object and paste it. Instead i am selecting the range of cells the group occupies and pasting the range as a picture, which is affecting the quality of the charts when displayed in the ppt. Can anybody tell me how can select the group of charts as a whole and paste it onto the ppt so that the quality of the display will be retained?
Here is the macro i am using:
Code:
Sub Copy_Paste_to_PowerPoint3()
'Requires a reference to the Microsoft PowerPoint Library via the Tools - Reference menu in the VBE
Dim ppApp As PowerPoint.Application
Dim ppSlide As PowerPoint.Slide
Dim SheetName As String
Dim TestRange As Range
Dim TestSheet As Worksheet
Dim TestChart As ChartObject
Dim PasteChart As Boolean
Dim PasteChartLink As Boolean
Dim ChartNumber As Long
Dim PasteRange As Boolean
Dim RangePasteType As String
Dim RangeName As String
Dim AddSlidesToEnd As Boolean
Dim shts As Worksheet
'Parameters
'SheetName - name of sheet in Excel that contains the range or chart to copy
'PasteChart -If True then routine will copy and paste a chart
'PasteChartLink -If True then Routine will paste chart with Link; if = False then paste chart no link
'ChartNumber -Chart Object Number
'
'PasteRange - If True then Routine will copy and Paste a range
'RangePasteType - Paste as Picture linked or unlinked, "HTML" or "Picture". See routine below for exact values
'RangeName - Address or name of range to copy; "B3:G9" "MyRange"
'AddSlidesToEnd - If True then appednd slides to end of presentation and paste. If False then paste on current slide.
'use active sheet. This can be a direct sheet name
SheetName = Sheet4.Name
'Setting PasteRange to True means that Chart Option will not be used
PasteRange = True
RangeName = ("ab6:at36") '"MyRange"
RangePasteType = "Picture"
rangelink = True
PasteChart = True
PasteChartLink = True
ChartNumber = 1
AddSlidesToEnd = False
'Error testing
On Error Resume Next
Set TestSheet = Sheets(SheetName)
Set TestRange = Sheets(SheetName).Range(RangeName)
Set TestChart = Sheets(SheetName).ChartObjects(ChartNumber)
On Error GoTo 0
If TestSheet Is Nothing Then
MsgBox "Sheet " & SheetName & " does not exist. Macro will exit", vbCritical
Exit Sub
End If
If PasteRange And TestRange Is Nothing Then
MsgBox "Range " & RangeName & " does not exist. Macro will exit", vbCritical
Exit Sub
End If
If PasteRange = False And PasteChart And TestChart Is Nothing Then
MsgBox "Chart " & ChartNumber & " does not exist. Macro will exit", vbCritical
Exit Sub
End If
'Look for existing instance
On Error Resume Next
Set ppApp = GetObject(, "PowerPoint.Application")
On Error GoTo 0
'Create new instance if no instance exists
If ppApp Is Nothing Then Set ppApp = New PowerPoint.Application
'Add a presentation if none exists
If ppApp.Presentations.Count = 0 Then ppApp.Presentations.Add
'Make the instance visible
ppApp.Visible = True
'Check that a slide exits, if it doesn't add 1 slide. Else use the last slide for the paste operation
If ppApp.ActivePresentation.Slides.Count = 0 Then
Set ppSlide = ppApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
Else
If AddSlidesToEnd Then
'Appends slides to end of presentation and makes last slide active
ppApp.ActivePresentation.Slides.Add ppApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank
ppApp.ActiveWindow.View.GotoSlide ppApp.ActivePresentation.Slides.Count
Set ppSlide = ppApp.ActivePresentation.Slides(ppApp.ActivePresentation.Slides.Count)
Else
'Sets current slide to active slide
Set ppSlide = ppApp.ActivePresentation.Slides(3)
End If
End If
'Options for Copy & Paste Ranges and Charts
If PasteRange = True Then
'Options for Copy & Paste Ranges
If RangePasteType = "Picture" Then
'Paste Range as Picture
Worksheets(SheetName).Range(RangeName).Copy
'ppslide.shapes.pastespecial(pppasteenhancedmetafile)
'ppSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile, link:=rangelink).Select
'ppSlide.Shapes.PasteSpecial ppPasteEnhancedMetafile
ppSlide.Shapes.PasteSpecial (ppPasteEnhancedMetafile)
Else
'Paste Range as HTML
Worksheets(SheetName).Range(RangeName).Copy
ppSlide.Shapes.PasteSpecial(ppPasteHTML, link:=rangelink).Select
End If
Else
'Options for Copy and Paste Charts
Worksheets(SheetName).Activate
ActiveSheet.ChartObjects(ChartNumber).Select
If PasteChartLink = True Then
'Copy & Paste Chart Linked
ActiveChart.ChartArea.Copy
ppSlide.Shapes.PasteSpecial (ppPasteEnhancedMetafile)
Else
'Copy & Paste Chart Not Linked
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
ppSlide.Shapes.Paste.Select
End If
End If
'Center pasted object in the slide
''ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
''ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
AppActivate ("Microsoft PowerPoint")
Set ppSlide = Nothing
Set ppApp = Nothing
End Sub
Please help me out with this issue.
Hi
I have a group of charts on an excel worksheet that I need to copy onto a powerpoint slide. I have 4 charts put together as one group on a sheet which I want to copy to a specific slide of an already running presentation. I am not able to select the group as on object and paste it. Instead i am selecting the range of cells the group occupies and pasting the range as a picture, which is affecting the quality of the charts when displayed in the ppt. Can anybody tell me how can select the group of charts as a whole and paste it onto the ppt so that the quality of the display will be retained?
Here is the macro i am using:
Code:
Sub Copy_Paste_to_PowerPoint3()
'Requires a reference to the Microsoft PowerPoint Library via the Tools - Reference menu in the VBE
Dim ppApp As PowerPoint.Application
Dim ppSlide As PowerPoint.Slide
Dim SheetName As String
Dim TestRange As Range
Dim TestSheet As Worksheet
Dim TestChart As ChartObject
Dim PasteChart As Boolean
Dim PasteChartLink As Boolean
Dim ChartNumber As Long
Dim PasteRange As Boolean
Dim RangePasteType As String
Dim RangeName As String
Dim AddSlidesToEnd As Boolean
Dim shts As Worksheet
'Parameters
'SheetName - name of sheet in Excel that contains the range or chart to copy
'PasteChart -If True then routine will copy and paste a chart
'PasteChartLink -If True then Routine will paste chart with Link; if = False then paste chart no link
'ChartNumber -Chart Object Number
'
'PasteRange - If True then Routine will copy and Paste a range
'RangePasteType - Paste as Picture linked or unlinked, "HTML" or "Picture". See routine below for exact values
'RangeName - Address or name of range to copy; "B3:G9" "MyRange"
'AddSlidesToEnd - If True then appednd slides to end of presentation and paste. If False then paste on current slide.
'use active sheet. This can be a direct sheet name
SheetName = Sheet4.Name
'Setting PasteRange to True means that Chart Option will not be used
PasteRange = True
RangeName = ("ab6:at36") '"MyRange"
RangePasteType = "Picture"
rangelink = True
PasteChart = True
PasteChartLink = True
ChartNumber = 1
AddSlidesToEnd = False
'Error testing
On Error Resume Next
Set TestSheet = Sheets(SheetName)
Set TestRange = Sheets(SheetName).Range(RangeName)
Set TestChart = Sheets(SheetName).ChartObjects(ChartNumber)
On Error GoTo 0
If TestSheet Is Nothing Then
MsgBox "Sheet " & SheetName & " does not exist. Macro will exit", vbCritical
Exit Sub
End If
If PasteRange And TestRange Is Nothing Then
MsgBox "Range " & RangeName & " does not exist. Macro will exit", vbCritical
Exit Sub
End If
If PasteRange = False And PasteChart And TestChart Is Nothing Then
MsgBox "Chart " & ChartNumber & " does not exist. Macro will exit", vbCritical
Exit Sub
End If
'Look for existing instance
On Error Resume Next
Set ppApp = GetObject(, "PowerPoint.Application")
On Error GoTo 0
'Create new instance if no instance exists
If ppApp Is Nothing Then Set ppApp = New PowerPoint.Application
'Add a presentation if none exists
If ppApp.Presentations.Count = 0 Then ppApp.Presentations.Add
'Make the instance visible
ppApp.Visible = True
'Check that a slide exits, if it doesn't add 1 slide. Else use the last slide for the paste operation
If ppApp.ActivePresentation.Slides.Count = 0 Then
Set ppSlide = ppApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
Else
If AddSlidesToEnd Then
'Appends slides to end of presentation and makes last slide active
ppApp.ActivePresentation.Slides.Add ppApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank
ppApp.ActiveWindow.View.GotoSlide ppApp.ActivePresentation.Slides.Count
Set ppSlide = ppApp.ActivePresentation.Slides(ppApp.ActivePresentation.Slides.Count)
Else
'Sets current slide to active slide
Set ppSlide = ppApp.ActivePresentation.Slides(3)
End If
End If
'Options for Copy & Paste Ranges and Charts
If PasteRange = True Then
'Options for Copy & Paste Ranges
If RangePasteType = "Picture" Then
'Paste Range as Picture
Worksheets(SheetName).Range(RangeName).Copy
'ppslide.shapes.pastespecial(pppasteenhancedmetafile)
'ppSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile, link:=rangelink).Select
'ppSlide.Shapes.PasteSpecial ppPasteEnhancedMetafile
ppSlide.Shapes.PasteSpecial (ppPasteEnhancedMetafile)
Else
'Paste Range as HTML
Worksheets(SheetName).Range(RangeName).Copy
ppSlide.Shapes.PasteSpecial(ppPasteHTML, link:=rangelink).Select
End If
Else
'Options for Copy and Paste Charts
Worksheets(SheetName).Activate
ActiveSheet.ChartObjects(ChartNumber).Select
If PasteChartLink = True Then
'Copy & Paste Chart Linked
ActiveChart.ChartArea.Copy
ppSlide.Shapes.PasteSpecial (ppPasteEnhancedMetafile)
Else
'Copy & Paste Chart Not Linked
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
ppSlide.Shapes.Paste.Select
End If
End If
'Center pasted object in the slide
''ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
''ppApp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
AppActivate ("Microsoft PowerPoint")
Set ppSlide = Nothing
Set ppApp = Nothing
End Sub
Please help me out with this issue.
Hello,
It is possible to link excel charts to powerpoint if you only try to link the chart in new office 2007.
If there is any text next to the chart that you link at same time to the powerpoint, the linking changes the look of resulting linked chart.
Does anyone know how to avoid this without linking every object at time? (It is lot more efficient to link multiple objects at a time)
regards,
Ukko
ps. MS support doesent yet know is this a feature or a bug in the software
I have a excel sheet that has multiple charts in it. There is some vba code
that copies the charts into powerpoint. My problem is that sometimes one
chart and plot area is off a little from a different chart, so when it copies
into powerpoint, it does not look aligned properly. Does anyone know of any
way to force the plot and chart areas to be set the same values for all the
charts on the worksheet, before it gets copied over?
Thanks,
Travis
I am working on a project in which we need to be able to view 180+ charts
easily. I wanted to insert them into PowerPoint easily, but am having
trouble finding a way to do that.
Thanks!
|
|