Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

PPTools

Image Export converts PowerPoint slides to high-quality images.

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

FixLinks prevents broken links when you distribute PowerPoint presentations

Optimizer saves disk space and bandwidth, "right-sizes" your PowerPoint presentations for email, screenshow or printing

PPT2HTML gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Prep4PDF preserves interactivity in PowerPoint presentations when you convert to PDF

Invoke PPT and run a macro from VB

Sub RunPPT-InvokeMacro()
' Execute Powerpoint and invoke the macro EXAMPLE
' EXAMPLE must be available to PPT, in an auto-loaded add-in, for example

' Start PowerPoint
Dim oPPTApp As PowerPoint.Application

On Error Resume Next
Set oPPTApp = New PowerPoint.Application
oPPTApp.Visible = True

' Were we able to start PPT?
If Err.Number <> 0 Then
oPPTApp.Quit
Set oPPTApp = Nothing
Exit Sub
End If

' Insert other error/sanity checks here to ensure that there really is an instance
' of PPT loaded

' Having established that PPT is loaded you could also test for the presence of the expected add-in
Dim lTemp as Long
Dim bAddinLoaded as Boolean
For lTemp = 1 to oPPTApp.Addins.Count
if oPPTApp.Addins(lTemp) = "YourAddin" then
bAddinLoaded = True
end if
Next lTemp

if not bAddinLoaded Then
oPPTApp.Quit
Set oPPTApp = Nothing
Exit Sub
End if

oPPTApp.Run "EXAMPLE"

' And quit PPT
oPPTApp.Quit

End Sub

Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2010 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.
Español    Deutsch    Français    Português    Italiano    Nederlands    Greek    Japanese    Korean    Chinese

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Invoke PPT and run a macro from VB
http://www.pptfaq.com/FAQ00580.htm
Last update 14 October, 2008
Created: