+ Reply to Thread
Results 1 to 5 of 5

Running a Powerpoint Macro from Excel

Hybrid View

  1. #1
    smonczka
    Guest

    Running a Powerpoint Macro from Excel

    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.Application")

    PPT.Presentations.Open "C:\My Documents\PPTAutomation.ppt", ,
    ,False

    ' Note that the file name and the module
    ' name are required to path the macro correctly.
    PPT.Run "PPTAutomation.ppt!Module1.AutomationTest"

    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.Application")

    PPApp.AddIns.Application.Run ("GetReturnValue")


    End Sub

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


  2. #2
    Tushar Mehta
    Guest

    Re: Running a Powerpoint Macro from Excel

    Multiposted in .powerpoint.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <1123890440.496077.136010@g43g2000cwa.googlegroups.com>,
    smonczka@gmail.com says...
    > 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.Application")
    >
    > PPT.Presentations.Open "C:\My Documents\PPTAutomation.ppt", ,
    > ,False
    >
    > ' Note that the file name and the module
    > ' name are required to path the macro correctly.
    > PPT.Run "PPTAutomation.ppt!Module1.AutomationTest"
    >
    > 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.Application")
    >
    > PPApp.AddIns.Application.Run ("GetReturnValue")
    >
    >
    > End Sub
    >
    > I'm open to any sugestions you might have. Thanks
    > Steve
    >
    >


  3. #3
    smonczka
    Guest

    Re: Running a Powerpoint Macro from Excel

    Tushar,

    This was multi posted because after posting the original message here I
    realized it was probably a Powerpoint question not an excel question.
    And as I have not received any replies to this post here it would
    appear that I was incorrect in posting the question to this news group.

    I am sorry if I did anything inappropriate by doing so.

    Thank you,
    Steve


  4. #4
    Tushar Mehta
    Guest

    Re: Running a Powerpoint Macro from Excel

    Hi Steve,

    What I was doing was alerting people that they may want to check the
    other group for possible duplicate responses.

    In case you would like to know and were unaware of the issues...

    Multiposting means posting the same request independently to two or
    more groups. Effectively, those who respond in one group are unaware
    of the discussion in the other group(s).

    Cross-posting, on the other hand, is posting the same message to both
    groups. Typically, responses to such a post are automatically posted
    to both groups. That way all those helping solve a problem are aware
    of what all the others have contributed.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

    In article <1124121195.630304.177390@g47g2000cwa.googlegroups.com>,
    smonczka@gmail.com says...
    > Tushar,
    >
    > This was multi posted because after posting the original message here I
    > realized it was probably a Powerpoint question not an excel question.
    > And as I have not received any replies to this post here it would
    > appear that I was incorrect in posting the question to this news group.
    >
    > I am sorry if I did anything inappropriate by doing so.
    >
    > Thank you,
    > Steve
    >
    >


  5. #5
    smonczka
    Guest

    Re: Running a Powerpoint Macro from Excel

    Tushar, thank you very much for the explination. It makes perfect
    sence and it is nice to have such helpfull people in the groups to
    explain this stuff to the noobies like myself.

    Steve


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1