Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rmuhammad
Creator
Creator

Macro to export all charts all sheets to PPT as one chart per slide

The macro in attached qvw example exports all charts all sheets to PPT as one chart per slide.

Code:

Sub Export_All_Chart_Images()

    set objPPT = CreateObject("PowerPoint.Application")

  objPPT.Visible = True

  Set objPresentation = objPPT.Presentations.Add

  For i = 0 To ActiveDocument.NoOfSheets - 1

        Set MySheet = ActiveDocument.GetSheet(i)

        MyCharts=MySheet.GetSheetObjects

            For X =lbound(MyCharts) to ubound(MyCharts)

                   

   Set PPSlide = objPresentation.Slides.Add(i+X+1,11)

                    'msgbox("Chart: " & MyCharts(X).GetObjectId)

                     Set obj = ActiveDocument.GetSheetObject(MyCharts(X).GetObjectId)

                     IF Obj.GetObjectType >= 10 AND Obj.GetObjectType =< 16 Then           

  obj.CopyBitmapToClipboard

  PPSlide.Shapes.Paste

  End if

            Next

    Next 

    Set PPSlide = Nothing

  Set PPPres = Nothing

End Sub

2 Replies
beck_bakytbek
Master
Master

Hi Rashid,

Thanks a lot for your sharing,

your Macro for Multiple Export in PPT is very powerful

thanks a lot

beck

santiago_respane
Specialist
Specialist

Excellent! Thanks a lot for sharing!

Very powerful and needed macro code!!