Hi. I have an excel workbook that is automatically updated with new data that then changes charts embedded into the workbook on a weekly basis. I also have a powerpoint deck that has those charts as linked charts and set to automatically update when the powerpoint is opened.
What I would like to do is to create a macro that from the excel file will open the powerpoint deck and update the links. I found that I am able to open the powerpoint with the following code, but because it is opening from a macro, I suspect, the links within the deck do not refresh.
I then found another thread with a similar question that was answered with using the following code. However, when I try to implement it I receive a 429 error saying "ActiveX component can't create object". I have the active X reference library selected as well as the MS PowerPoint reference library selected. Can anyone suggest where I am going wrong with my current code or maybe a different suggestion completely?
Thanks!
What I would like to do is to create a macro that from the excel file will open the powerpoint deck and update the links. I found that I am able to open the powerpoint with the following code, but because it is opening from a macro, I suspect, the links within the deck do not refresh.
Code:
Application.DisplayAlerts = False
Set PPT = New PowerPoint.Application
PPT.Visible = True
PPT.Presentations.Open Filename:="C:\Operations Weekly Deck - 02.08.2016.pptx"
Application.DisplayAlerts = True
End Sub
I then found another thread with a similar question that was answered with using the following code. However, when I try to implement it I receive a 429 error saying "ActiveX component can't create object". I have the active X reference library selected as well as the MS PowerPoint reference library selected. Can anyone suggest where I am going wrong with my current code or maybe a different suggestion completely?
Code:
Sub powerpoint_refresh()
Dim pApp As Object
Dim pPreso As Object
Dim pSlide As Object
Dim sPreso As String
sPreso = "C:\Operations Weekly Deck - 02.08.2016.pptx"
Set pApp = GetObject(, "PowerPoint.application")
If Err.Number <> 0 Then
Set pApp = CreateObject("PowerPoint.application")
pApp.Visible = True
End If
Set pPreso = pApp.Presentations(sPreso)
If Err.Number <> 0 Then
Set pPreso = paoo.Presentations.Open(Filename:=sPreso)
End If
pPreso.UpdateLinks
End Sub
Thanks!