method activate of object chartdata failed

reza_doang

Board Regular
Joined
May 31, 2010
Messages
187
Hi,

I have below macro to update the graphs automatically from Excel to PPT.
i was run normally using old laptop, now i upgraded the 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

[TABLE="class: grid, width: 500, align: left"]
[TR]
[TD]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


[/TD]
[/TR]
[/TABLE]
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,223,723
Messages
6,174,123
Members
452,546
Latest member
Rafafa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top