Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Visual Basic the same as Visual Studio 2008? Mike Stewart Excel Worksheet Functions 5 January 11th 09 04:58 PM
Visual BASIC in Excel Emerogork via OfficeKB.com Excel Worksheet Functions 1 August 27th 07 07:06 PM
Visual BASIC in Excel Emerogork via OfficeKB.com Excel Worksheet Functions 1 August 27th 07 04:53 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
Automate Excel to powerpoint - Graphs along with Datasheet (not workbook) Hari Prasadh Charts and Charting in Excel 4 February 17th 05 02:44 PM


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"