Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Possible to automate Powerpoint from within Excel of Visual Basic?
Hi!
I have written a VBA macro in my Powerpoint file. I want to be able to have Excel (or a Visual Basic standalone program) to load Powerpoint and automatically run this macro. Does anyone know if this is doable? I tried recording my keystrokes into an Excel macro, but the farthest I was able to get was to activate Powerpoint. Thanks for your help. Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Possible to automate Powerpoint from within Excel of Visual Basic?
Hi Greg - it can be done.
In your Excel VBProject, you need to create a reference to the 'Microsoft PowerPoint 8.0 Object Library' or whatevery version you have available. Your procedure would then look something like this: Sub RunPowerpointMacro() Dim oApp As PowerPoint.Application 'create an instance of Powerpoint and make it visible Set oApp = New PowerPoint.Application oApp.Visible = True 'open the presentation oApp.Presentations.Open "C:\MyPresentation.ppt" 'run the macro oApp.Run "MyPresentation.ppt!Module1.TestMacro" End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Possible to automate Powerpoint from within Excel of Visual Basic?
I missed the original post, but I have posted some Excel-PowerPoint
examples he http://www.geocities.com/jonpeltier/Excel/XL_PPT.html - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ James wrote: Hi Greg - it can be done. In your Excel VBProject, you need to create a reference to the 'Microsoft PowerPoint 8.0 Object Library' or whatevery version you have available. Your procedure would then look something like this: Sub RunPowerpointMacro() Dim oApp As PowerPoint.Application 'create an instance of Powerpoint and make it visible Set oApp = New PowerPoint.Application oApp.Visible = True 'open the presentation oApp.Presentations.Open "C:\MyPresentation.ppt" 'run the macro oApp.Run "MyPresentation.ppt!Module1.TestMacro" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is Visual Basic the same as Visual Studio 2008? | Excel Worksheet Functions | |||
Visual BASIC in Excel | Excel Worksheet Functions | |||
Visual BASIC in Excel | Excel Worksheet Functions | |||
changing the visual basic in office 2003 to visual studio net | Excel Discussion (Misc queries) | |||
Automate Excel to powerpoint - Graphs along with Datasheet (not workbook) | Charts and Charting in Excel |