Hello,
I can't figure out how to auto close a 'Open File' location. As of right now, I need to press "cancel" a bunch of times as the powerpoint runs its link updates.
I can't figure out how to auto close a 'Open File' location. As of right now, I need to press "cancel" a bunch of times as the powerpoint runs its link updates.
VBA Code:
Sub UpdateChartData()
Dim pptChart As Chart
Dim pptChartData As ChartData
Dim pptWorkbook As Object
Dim sld As Slide
Dim shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasChart Then
Set pptChart = shp.Chart
Set pptChartData = pptChart.ChartData
pptChartData.Activate
Set pptWorkbook = pptChartData.Workbook
On Error Resume Next
'update first link
pptWorkbook.UpdateLink pptWorkbook.LinkSources(1)
On Error GoTo 0
pptWorkbook.Close True
End If
Next
Next
Set pptWorkbook = Nothing
Set pptChartData = Nothing
Set pptChart = Nothing
Application.DisplayAlerts = True
End Sub