View Single Post
 
Old 04-11-2012, 10:34 AM
CatMan CatMan is offline Windows 7 32bit Office 2010 32bit
Intermediate
 
Join Date: Apr 2012
Posts: 39
CatMan is on a distinguished road
Default Excel VBA to automate PowerPoint

Hello Forum, thank you for taking the time to look at this.

In an Excel module (Excel is host) I am opening an existing PPT like this:

Code:
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  <--this is a typo, should be 'with ppte' as explained 2 threads down)
    .Visible = True
    .Presentations.Open ("C:\Users\User\Documents\MyPPT.ppt")
End With
Next I want to activate a user defined slide, the following code works ok as a PowerPoint macro:

Code:
ActiveWindow.View.GotoSlide 3 'works inside ppt
but not inside the Excel module:

Code:
With ppte
       .View.GotoSlide 11
End With
I get a run-time error (429). I notice I am not referencing the slide object (oPSe) but all my attempts to work this have failed.

Last edited by CatMan; 04-11-2012 at 04:59 PM.
Reply With Quote