Team,
I am trying to connect an Excel Spreadsheet to a PowerPOint file in the same folder with a relative address.
It is not working. Can you please help?
Thank you,
( I copied from the Office Lab exactly, but it is not working)
The code is
Sub Refresh(ParamArray var() As Variant)
Dim pApp As Object
Dim pPreso As Object
Dim pSlide As Object
Dim sPreso As String
'Define path to Powerpoiunt Dashboard file path
sPreso = Dir(ActiveWorkbook.Path & ".\Dashboard-Disaster_Recovery_Yearbook_Metrics.pptm")
'Open and reference PowerPoint Dashboard file
On Error Resume Next
Set pApp = GetObject(class, "PowerPoint.Application")
If Err.Number <> 0 Then
Set pApp = CreateObject("PowerPoint.Application")
pApp.Visible = True
End If
On Error Resume Next
Set pPreso = pApp.Presentations(sPreso)
If Err.Number <> 0 Then
Set pPreso = pApp.Presentations.Open(Filename:=sPreso)
End If
'Update every chart (slide 1) in Param Array
Dim varSize As Integer
Dim i As Integer
Dim j As Integer
varSize = UBound(var) - LBound(var) + 1
For i = 0 To (varSize - 1)
pPreso.Slides(1).Shapes(var(i)).LinkFormat.Update
Next i
'For j = 0 To (varSize - 1)
'pPreso.Slides(2).Shapes(var(i)).LinkFormat.Update
End Sub
I am trying to connect an Excel Spreadsheet to a PowerPOint file in the same folder with a relative address.
It is not working. Can you please help?
Thank you,
( I copied from the Office Lab exactly, but it is not working)
The code is
Sub Refresh(ParamArray var() As Variant)
Dim pApp As Object
Dim pPreso As Object
Dim pSlide As Object
Dim sPreso As String
'Define path to Powerpoiunt Dashboard file path
sPreso = Dir(ActiveWorkbook.Path & ".\Dashboard-Disaster_Recovery_Yearbook_Metrics.pptm")
'Open and reference PowerPoint Dashboard file
On Error Resume Next
Set pApp = GetObject(class, "PowerPoint.Application")
If Err.Number <> 0 Then
Set pApp = CreateObject("PowerPoint.Application")
pApp.Visible = True
End If
On Error Resume Next
Set pPreso = pApp.Presentations(sPreso)
If Err.Number <> 0 Then
Set pPreso = pApp.Presentations.Open(Filename:=sPreso)
End If
'Update every chart (slide 1) in Param Array
Dim varSize As Integer
Dim i As Integer
Dim j As Integer
varSize = UBound(var) - LBound(var) + 1
For i = 0 To (varSize - 1)
pPreso.Slides(1).Shapes(var(i)).LinkFormat.Update
Next i
'For j = 0 To (varSize - 1)
'pPreso.Slides(2).Shapes(var(i)).LinkFormat.Update
End Sub