Macro to advance PPT slide 
Author Message
 Macro to advance PPT slide

I'm running Office 2K/Win2K on a computer with three installed video
cards/monitors.  Excel is on monitor 2 and Powerpoint is on monitor 3
(plasma display for customers to read).  I'd like to add a CommandButton
(VBA code) on my Excel spreadsheet that advances the slide in Powerpoint
running in the full screen mode.  Appreciate any assistance.


Sat, 11 Jun 2005 15:29:28 GMT  
 Macro to advance PPT slide
I had a similar type deal with regards to running an MS program from within
Excel Program.  The first thing you will need to do is to go into
Tools>Reference, and checkmark "Microsoft Powerpoint" within the list of
References in the VBE.  Once you have done that, you will then want a code
at the top of the module from which you plan on controlling the slides in
PPT.

Dim MSPPT as PowerPoint.Application

Now after doing these 2 things, you can then using the following macro to
get a reference to PowerPoint depend on if it's already open or not.

Function StartPPT() As Boolean
    On Error Resume Next
    If MSPPT is Nothing Then
        Set MSPPT = GetObject(, "PowerPoint.Application")
        If Err.Number <> 0 Then
            'Since PowerPoint was not open, it will be opened by the
following command.
            Set MSPPT = New PowerPoint.Application
        End If
    End If
    StartPPT = Not (MSPPT Is Nothing)
End Function

The below code makes use of the above code.

Function OpenPPTFile(PPT_File as String)
    StartPPT
    OnError Goto ErrHandle
    'This is the location for the Open code and may also want to put in a
check to be sure that the file isn't already open before trying to open the
file.
    OpenPPTFile = True
    Exit Function
ErrHandle:
    OpenPPTFile = False
End Function

Note:  You will use the MSPPT object variable to refer to the PowerPoint
Application Object such as "MSPPT.Presentations.Open"

For additional info of knowing how to control PowerPoint objects, you will
want to turn to the Power Point help files, MSDN Library, and/or Power Point
newsgroup.  This should get you started with controlling Powerpoint from
within Excel's VBA or any of the MS programs within it's VBA.

--
Ronald R Dodge, Jr
Production Statistician
Master MOUS 2000


Quote:
> I'm running Office 2K/Win2K on a computer with three installed video
> cards/monitors.  Excel is on monitor 2 and Powerpoint is on monitor 3
> (plasma display for customers to read).  I'd like to add a CommandButton
> (VBA code) on my Excel spreadsheet that advances the slide in Powerpoint
> running in the full screen mode.  Appreciate any assistance.



Tue, 14 Jun 2005 00:13:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PPT 2002 Slide Advance

2. Excel Macro to Advance PPT

3. Advance slide macro?

4. To advance a slide using Macro script.

5. slide show does not advance past 3rd slide

6. VBA code to advance in Slide Show and in Slide Sorter in Dual Screen Mode

7. Importing PPT files into Master PPT slide show

8. PPT slide opening up when PPT opens up.

9. certain ppt x slides crash ppt 2001

10. PPT 97 - Display 2 slides during slide show


 
Powered by phpBB® Forum Software © phpBB Group