Consulting

Results 1 to 2 of 2

Thread: method activate of object chartdata failed

  1. #1

    method activate of object chartdata failed

    Hi,

    I have below macro to update the graphs automatically from Excel to PPT.
    it was run normally using old laptop, now i upgraded to new laptop, and when i ran it showed error
    "method activate of object chartdata failed"

    can you please help whats wrong with it ?

    below the macro

    Sub UpdateAll()‘UnGroup All
    Dim oShp As Shape
    Dim oSlp As Slide
    For Each oSlp In ActivePresentation.Slides
    For Each oShp In oSlp.Shapes
    Select Case oShp.Type
    Case Is = msoGroup, msoTable
    oShp.Ungroup
    End Select
    Next
    Next
    Call UpdateObject
    End Sub
    Private Sub UpdateObject()
    Dim oShp As Shape
    Dim oSld As Slide
    For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
    If oShp.Type = msoLinkedOLEObject Then
    oShp.LinkFormat.Update
    End If
    Next
    Next
    Call UpdateCharts
    End Sub
    Private Sub UpdateCharts()
    Dim oSld As Slide
    Dim oShp As PowerPoint.Shape
    For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
    With oShp
    If .HasChart Then
    .Chart.ChartData.Activate
    .Chart.ChartData.Workbook.Close
    .Chart.Refresh
    End If
    End With
    Next oShp
    Next oSld
    End Sub



  2. #2
    please ignore, found the answer

Posting Permissions

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