Asked By
jayson mars
90 points
N/A
Posted on - 04/17/2012
Hi,
I've been using macros in MSExcel for several months now and I know how powerful these macros are.
How can I use Excel as a host to open a PowerPoint presentation and then play on a certain slide number automatically?
Below is my attempt on how to do that:
Dim ppte As Object
Dim oPAe As PowerPoint.Application
Dim oPPe As PowerPoint.Presentation
Dim oPSe As PowerPoint.Slide
Dim oShapee As PowerPoint.Shape
Dim oPicturee As PowerPoint.Shape
Â
With ppt    .Visible = True
  .Presentations.Open ("C:UsersUser2DocumentsMyPresentation.ppt")
End With
Â
This is what I did to go to a specific slide:
Â
ActiveWindow.View.GotoSlide 6
Â
However, I get an run-time error (429). Any advice?
Automate PowerPoint Using Excel VBA – Is it possible?
Hi
This particular error (Runtime error 429) generally happens when you are trying to access a program that’s fail to complete the action and/or create the object that you requested.
More precisely this error is more common to happen when using VBA to connect with MS Office apps. (In your case, you used VBA to access to MS Power point).Your code was:
 Dim ppte As Object
 Dim oPAe As PowerPoint.Application
 Dim oPPe As PowerPoint.Presentation
 Dim oPSe As PowerPoint.Slide
 Dim oShapee As PowerPoint.Shape
 Dim oPicturee As PowerPoint.Shape
 With ppt     .Visible = True
    .Presentations.Open ("C:UsersUser2DocumentsMyPresentation.ppt")
 End With
 ActiveWindow.View.GotoSlide 6 // (this line that may caused the error)Â
Try to use the code below (just add a point "." before  the line that caused the error):
With ppt     .Visible = True
    .Presentations.Open ("C:UsersUser2DocumentsMyPresentation.ppt")
    .ActiveWindow.View.GotoSlide 6
 End WithÂ
Good Luck