Connection to ppt from Excel

Tomcoll67

New Member
Joined
May 13, 2019
Messages
23
Team ,
I have 2 problems.
First I need to only have a single ppt open (2 charts are updated with the same cell in Excel.
Second the Slide needs to be updated when a change occurs

'For j = 0 To (varSize - 1)
'pPreso.Slides(2).Shapes(var(i)).LinkFormat.Update


Is the code that is causing error and not updating the slide.




VBA Code:
Sub Refresh(ParamArray var() As Variant)

'Declare powerpoint app
Dim pApp As PowerPoint.Application
Set pApp = New PowerPoint.Application
pApp.Visible = True

'Connect to current Powerpoint app
pApp.Presentations.Open (ActiveWorkbook.Path & "\Dashboard.pptx")

'On Error Resume Next
Dim pPreso As PowerPoint.Presentation
Set pPreso = pApp.ActivePresentation



'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(2).Shapes(var(i)).LinkFormat.Update
    Next i

'For j = 0 To (varSize - 1)
    'pPreso.Slides(2).Shapes(var(i)).LinkFormat.Update


End Sub



Thank you,
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,215,446
Messages
6,124,895
Members
449,194
Latest member
JayEggleton

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