Consulting

Results 1 to 6 of 6

Thread: Update data for powerpoint show

  1. #1

    Update data for powerpoint show

    I am designing a KPI Portal where data from Excel is imbedded in a PowerPoint slideshow. Currently, all the data updates in the presentation file, but once I save it as a macro-enabled slideshow, the updates never occur. I have a Macro that from what I understand will update slides during the show, but it doesn't seem to work.

    Here is my code:
    Sub OnSlideShowPageChange()
    Dim i As Integer
    i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
    If i <> 1 Then Exit Sub
    ' MsgBox "working"
    Dim osld As Slide
    Dim oshp As Shape
    Dim opres As Presentation
    Dim L As Long
    On Error Resume Next
    Set opres = objWindow.Parent
    L = objWindow.View.CurrentShowPosition
    If L < opres.Slides.Count Then
    Set osld = objWindow.View.Slide
    For Each oshp In objWindow.Parent.Slides(L + 1).Shapes
    oshp.LinkFormat.Update
    Next oshp
    Else
    For Each oshp In objWindow.Parent.Slides(1).Shapes
    oshp.LinkFormat.Update
    Next oshp
    End If
    End Sub


    Any ideas what is going wrong?

    Thanks

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    OnSlideShowPageChange is very old code left over from PowerPoint 97. It is not reliable.

    To improve things add an item from the control toolbox (eg. Command button - no code needed) and use the selection pane to set to invisible.

    Save and try again.

    You might want to explain EXACTLY what the code should do because it is a little confused.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    Quote Originally Posted by John Wilson View Post
    OnSlideShowPageChange is very old code left over from PowerPoint 97. It is not reliable.

    To improve things add an item from the control toolbox (eg. Command button - no code needed) and use the selection pane to set to invisible.

    Save and try again.

    You might want to explain EXACTLY what the code should do because it is a little confused.



    Hi John,

    This is code I got from a Microsoft forum that I believe you responded to.

    The code is supposed to update my slideshow. Ideally, it only needs to update once upon opening, but this is supposed to update every time I change slides I think.

    Additionally, I am having an issue with charts updating. What is the best way it insert a chart from excel and have it change as the excel chart changes? current state is, while in the project file, as I add new data points in excel, the excel chart updates, but the chart I pasted into powerpoint will not .

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    If you have linked items they should update when the file is opened anyway (no code needed) If you want the items to update while the show is running you would need code.

    Sub OnSlideShowPageChange(SSW As SlideShowWindow)
    If SSW.View.CurrentShowPosition = 1 Then
    Dim osld As Slide
    Dim oshp As Shape
    On Error Resume Next
    For Each osld In ActivePresentation.Slides
    For Each oshp In osld.Shapes
    oshp.LinkFormat.Update
    Next oshp
    Next osld
    End Sub
    Don't forget the info above re. command button
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    Quote Originally Posted by John Wilson View Post
    If you have linked items they should update when the file is opened anyway (no code needed) If you want the items to update while the show is running you would need code.

    Sub OnSlideShowPageChange(SSW As SlideShowWindow)
    If SSW.View.CurrentShowPosition = 1 Then
    Dim osld As Slide
    Dim oshp As Shape
    On Error Resume Next
    For Each osld In ActivePresentation.Slides
    For Each oshp In osld.Shapes
    oshp.LinkFormat.Update
    Next oshp
    Next osld
    End Sub
    Don't forget the info above re. command button
    Should the code be in a slide or in a module?

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Just in a standard module.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •