Running a Powerpoint Macro from Excel

S

smonczka

I am atempting to exacute a PPT macro from inside excel. Does anyone
have a sugestion on how to do this. I am running office 2003 on an XP
machine. All files I am working with are in the same directory.

I have found the following code that is suposed to work but dosn't...

The first one errors out because it can not seem to open the PPT file.

Sub PPTTest()
Dim PPT as Object
Set PPT = CreateObject("PowerPoint.Appli­cation")
PPT.Presentations.Open "C:\My Documents\PPTAutomation.ppt", ,
,False
PPT.Run "PPTAutomation.ppt!Module1.Aut­omationTest"
End Sub


The second example is used by creating an add-in in PPT and then
calling the add in from Excel but is unable to reference the object.


Sub mymacro()
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Set PPApp = CreateObject("Powerpoint.Appli­cation")
PPApp.AddIns.Application.Run ("GetReturnValue")
End Sub


I'm open to any sugestions you might have. Thanks
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top