Results 1 to 3 of 3

Thread: 2007 PPT Chart Data is not Reflecting In Chart

  1. #1
    Member littleiitin's Avatar
    Join Date
    Aug 2011
    Posts
    90
    Rep Power
    14

    2007 PPT Chart Data is not Reflecting In Chart

    Hi,

    I am Updating 2007 PPT Charts Data using Code in excel. Data files are kept in Separate Excel files.
    Picking excel and updating chart. Data is in Charts Excel Sheet, However new Row or column is not reflecting in Chart.

    Even Using Below Code I am Increasing the Size of Data Range, It is still not reflecting in chart. This Code I am using directly in PPT.

    If I am doing Samething manually it starts Reflecting.

    I am not able to use the setsourcedata Method too.



    Code:
    Sub Refresh()
        
        Dim chtObj      As Chart
        Dim wbkCht      As Object
        Dim wksCht      As Object
        Dim objPres     As Object
        Dim objSld      As Object
        Dim objShp      As Object
        
        Set objPres = ActivePresentation
        With objPres
            For Each objSld In .Slides
                For Each objShp In objSld.Shapes
                    If objShp.Type = msoChart Then
                        Set chtObj = objShp.Chart
                        With objShp.Chart.ChartData
                            .Activate
                            .Workbook.Application.WindowState = -4140
                            Set wbkCht = .Workbook
                            Set wksCht = .Workbook.worksheets(1)
                            .Workbook.Application.WindowState = -4140
                            'objShp.Chart.SetSourceData wksCht.Range("A1").CurrentRegion                        wksCht.ListObjects("Table1").Resize wksCht.Range("A1").CurrentRegion.Resize(wksCht.Range("A1").CurrentRegion.Rows.Count - 1, wksCht.Range("A1").CurrentRegion.Columns.Count - 1)
                            wksCht.ListObjects("Table1").Resize wksCht.Range("A1").CurrentRegion
                        End With
                    End If
                Next
            Next
        End With
        
    End Sub
    Thanks In advance
    Rahul Kumar Singh
    Last edited by littleiitin; 04-27-2012 at 03:49 PM.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Is your chart linked to any external data, or is it having it's own source within the data sheet in its own workbook source?

  3. #3
    Member littleiitin's Avatar
    Join Date
    Aug 2011
    Posts
    90
    Rep Power
    14
    No Charts are not linked , these are normal 2007 Charts and I am Updating the data in data sheet of Chart using external file.

Similar Threads

  1. Replies: 1
    Last Post: 11-30-2012, 09:23 AM
  2. Excel Chart Showing Values on Angle: Nightingale Chart
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 0
    Last Post: 10-17-2012, 06:39 PM
  3. Replies: 1
    Last Post: 05-20-2012, 12:23 PM
  4. Replies: 3
    Last Post: 05-14-2012, 11:30 AM
  5. Get Chart's Source Data VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 2
    Last Post: 11-24-2011, 07:54 AM

Posting Permissions

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