3 Replies Latest reply: May 7, 2015 6:08 AM by Mariangeles Escudero RSS

    Macro to export more than one Sheet objects and all objects in this sheet into PPT

      Hello to everybody,

      I would like to export all of my objects from all my sheets into ppt, but I didn't get it.

      Looking into this community, I found a macro and I copied and pasted into my qv, but this macro only export one object.

      Do you know how to export all of the objects from all of the sheets into ppt?.

      This is the macro that only export one of the objetcs.

       

      sub ppt

        pos = activedocument.evaluate("=getactivesheetid()")

        set v = activedocument.Getvariable("vShowAll")

        v.SetContent 1,TRUE

       

        Set PPApp = CreateObject("Powerpoint.Application")

        PPApp.Visible = True

        Set PPPres = PPApp.Presentations.Add

       

        for j = 0 to ActiveDocument.NoOfSheets - 1

            ActiveDocument.Sheets(j).Activate

            ActiveDocument.GetApplication.WaitForIdle

            set s=ActiveDocument.ActiveSheet

            charts=s.GetSheetObjects

            Set PPSlide = PPPres.Slides.Add(1, 1)   

            PPSlide.Shapes(1).Delete

            PPSlide.Shapes(1).Delete

                  for i=lbound(charts) to ubound(charts)

                       if(UCASE(mid(charts(i).getobjectid,10,2)))="CH" then

      '                    Set PPSlide = PPPres.Slides.Add(1, 1)

      '                      PPSlide.Shapes(1).Delete ' removes the title

      '                    PPSlide.Shapes(1).Delete ' removes the text box

                           ActiveDocument.GetSheetObject(charts(i).getobjectid).CopyBitmapToClipboard

                           PPSlide.Shapes.Paste

                       end if

            next

        next

       

        'PPPres.SaveAs "C:\PresentationPPT.ppt"

        'PPPres.Close

        'PPApp.Quit

        Set PPSlide = Nothing

        Set PPPres = Nothing

        Set PPApp = Nothing

        set v = activedocument.Getvariable("vShowAll")

        v.SetContent 0,TRUE

        activedocument.sheets(pos).activate

        msgbox "PPT Extract Successful",64,"Complete"

      end sub

       

      Thanks a lot.

      Mariangeles.