A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Before you deal with the security problems I suggest that you open the presentation manually.
Then try the code below.
Have also a look at this thread:
http://answers.microsoft.com/en-us/office/forum...
Andreas.
Sub UpdateChart()
Dim oPPTApp As Object 'PowerPoint.Application
Dim oPPTShape As Object 'PowerPoint.Shape
Dim oGraph As Object 'PowerPoint.Chart
Dim rngNewRange As Excel.Range
'Try access to Powerpoint
On Error Resume Next
Set oPPTApp = GetObject(, "PowerPoint.Application")
On Error GoTo 0
If oPPTApp Is Nothing Then
MsgBox "Open your presentation first."
Exit Sub
End If
'Get current data in this sheet
Set rngNewRange = Range("A1").CurrentRegion
rngNewRange.Copy
With oPPTApp.ActivePresentation.Slides(1)
'Visit each Shape on Slide 1
For Each oPPTShape In .Shapes
'Check to see whether shape is an OLE object.
Select Case oPPTShape.Type
Case msoEmbeddedOLEObject
'Check to see whether OLE object is a Graph object.
If InStr(1, oPPTShape.OLEFormat.ProgId, "MSGraph.Chart", vbTextCompare) > 0 Then
'Set oGraph to the Chart object on the slide.
Set oGraph = oPPTShape.OLEFormat.Object
'Paste the cell range into the datasheet of that chart
oGraph.Parent.DataSheet.Range("A1").Paste True
End If
Case msoChart
'Get the Chart object
Set oGraph = oPPTShape.Chart
'Link to the data in Excel
oGraph.SetSourceData rngNewRange.Address(External:=True)
End Select
Next
End With
End Sub