I have a VBA code which is supposed to replace a word by another in a powerpoint. Nevertheless, when I try to run it I get the error 429 "ActiveX component can't create object" but I do not know why. Here is the code :
Sub pres()
Dim PowerPointApp As Object
Set PowerPointApp = CreateObject("PowerPoint.Application")
Dim myPres As Object
Set myPres = PowerPointApp.Presentations.Open("C:\Users\NAME\Desktop\PRESVBA\Pres.pptx")
Dim sld As Slide
Set sld = ActivePresentation.Slides(3)
Dim shp As Shape
For Each shp In sld.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
shp.TextFrame.TextRange.Text = Replace(shp.TextFrame.TextRange.Text, "Montant", "Amount")
End If
End If
Next shp
End Sub