Share via

Create PPTX / PPT programatically

Anonymous
2010-10-20T21:24:56+00:00

I would like to create programatically presentation based on data which I will get from Excel (PowerPivot)

Is it possible with PowerPoint object model (Microsoft.Office.Interop.PowerPoint).

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-10-20T23:36:38+00:00

Basic example of automating it from Excel.

Dim oPPT As Object 'PowerPoint.Application

Dim oPres As Object 'PowerPoint.Presentation

Dim oSld As Object 'PowerPoint.Slide

Range("A3:B25").CopyPicture

Set oPPT = CreateObject("PowerPoint.Application")

If Not oPPT Is Nothing Then

    oPPT.Visible = True 'make the window visible (optional)

    Set oPres = oPPT.presentations.Add(msoTrue)

    With oPres

        Set oSld = .Slides.AddSlide(1, .Designs(1).SlideMaster.CustomLayouts(1))

        With oSld

            With oSld.Shapes.Paste(1)

                .Top = 10

                .Left = 10

            End With

        End With

        .SaveAs "c:\temp\test.pptx", ppSaveAsDefault

    End With

Else

    MsgBox "PowerPoint object could not be instantiated.", vbExclamation

End If


Regards, Shyam Pillai. http://skp.mvps.org

Was this answer helpful?

0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-10-20T23:22:14+00:00

    I would like to get Pivot Tables from excels and put it as an image (gif, emf, wmf, etc) to the presentation slides.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2010-10-20T23:13:31+00:00

    What do you wish to do? Populate textboxes in PowerPoint with data from Excel? Create charts/tables? Creating presentation based on data is too broad a statement. :-)


    Regards, Shyam Pillai. http://skp.mvps.org

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2010-10-20T23:10:39+00:00

    thanky you.

    Any suggestion how to do it (links, code, etc)

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2010-10-20T22:57:00+00:00

    Yes, it is possible.


    Regards, Shyam Pillai. http://skp.mvps.org

    Was this answer helpful?

    0 comments No comments