Automation to directly update charts of Powerpoint Presentation from Excel using VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anubhav Mital
    New Member
    • Jun 2010
    • 11

    Automation to directly update charts of Powerpoint Presentation from Excel using VBA

    Friends!!!

    I am working on a project and in which I have to update the Charts in PPT again and again. I have one workbook in which my data is stored at a fixed gap, I know how to select it. And I also know how to activate the presentation but in that i don't know how to select the chart item and update its data. Help me out please.



    Regards
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    you can update the charts with a macro:
    By entering a page
    Code:
    Sub OnSlideShowPageChange()
    Dim i As Integer
        i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
        If i = 2 Then
            MsgBox "Your code goes here"
            ActivePresentation.UpdateLinks
        End If
    End Sub
    With a button
    Code:
    Sub Update_Data()
        MsgBox "Your code goes here"
        ActivePresentation.UpdateLinks
    End Sub
    See also attachments: Change the values in the Excel sheet and start the PPS.
    Attached Files

    Comment

    • Anubhav Mital
      New Member
      • Jun 2010
      • 11

      #3
      Thanks Guido Geurs

      But this is not relevant to my problem. I want to specify that the data to be inserted in chart is not particular and I am not using linked charts here. I want an alternate to that. I need some code so that I can reach out to a particular slide and find an already existing chart and then update its data by changing it with my new data.


      Regards,
      Anubhav

      Comment

      • Guido Geurs
        Recognized Expert Contributor
        • Oct 2009
        • 767

        #4
        Is this your problem:
        You have PP with a chart and you want to load data from an Excel workbook (more than one to choose from)?
        If not, is it possible to attach an example in bytes?

        Comment

        Working...