• 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.

How to copy grouped chart to powerpoint

Balajisx

Member
Hi Team,

I have a worksheet with mutliple charts and excel widgets. I have to paste each grouped chart into a powerpoint silde. I will be able to copy each chart or each shape individually to powerpoint using VBA. However I m struggling to copy and paste the grouped charts and shapes into powerpoint. below is the code i have used.

Please help me on this.



Option Explicit
Sub exportcharts()

Dim ppapp As PowerPoint.Application
Dim ppres As PowerPoint.Presentation
Set ppapp = New PowerPoint.Application
ppapp.Visible = msoTrue


Set ppres = ppapp.Presentations.Open(Application.GetOpenFilename(), , False)

Dim ppress As PowerPoint.Presentation

Set ppress = ppapp.ActivePresentation

Dim pslide As PowerPoint.Slide
Dim total_slide As Long

total_slide = ppres.Slides.Count

Dim ws As Worksheet
Dim cht As ChartObject
Dim i As Long
i = 2
For Each ws In Worksheets
For Each cht In ws.ChartObjects
cht.Copy
ppres.Slides(i).Shapes.PasteSpecial (ppPasteEnhancedMetafile)
i = i + 1
Next


Next

End Sub
 
Cross posted.
https://www.excelforum.com/excel-pr...how-to-copy-grouped-chart-to-power-point.html

Please read below link.
http://chandoo.org/forum/threads/new-users-please-read.294/

Specifically.

Please Don't
  • Cross-Posting. Generally, it is considered poor practice to cross post. That is to post the same question on several forums in the hope of getting a response quicker.
  • If you do cross-post, please put that in your post.
  • Also if you have cross-posted and get an answer elsewhere, have the courtesy of posting the answer here so other readers can learn from the answer also, as well as stopping people wasting their time on your answered question.
 
Hi Chihiro,

I am not aware that We should not do a cross posting. I apologize for that. Going forward I will make sure to add the answer if I get it from some other forum.

Regards,
Balajisx
 
Back
Top