Closed Thread
Results 1 to 7 of 7

Opening Powerpoint file from Excel

Hybrid View

  1. #1
    JakeyC
    Guest

    Opening Powerpoint file from Excel

    Hi -

    I have the following code to start a new instance of Powerpoint when
    the value in Cell A1 is greater than 10:

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
    Excel.Range)

    If Range("A1").Value > 10 Then
    Application.ActivateMicrosoftApp (xlMicrosoftPowerPoint)
    End If

    End Sub


    How can I adapt this code to specify which file to open in Powerpoint?
    It will always be the same file so I can hard code the filename into my
    macro, something like 'C:\My Folder\My Presentation.ppt

    Thanks in advance

    Jake


  2. #2
    Bob Phillips
    Guest

    Re: Opening Powerpoint file from Excel

    Jake,

    Try this

    Private Sub Workbook_SheetChange(ByVal Sh As Object, _
    ByVal Target As Excel.Range)
    Dim oPPT as Object

    If Range("A1").Value > 10 Then
    Set oPPT = GetObject("C:\My Folder\My Presentation.ppt")
    oPPT.Parent.Parent.Visible = True
    End If

    End Sub


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "JakeyC" <mrjsoftware@hotmail.com> wrote in message
    news:1133202443.193624.9480@f14g2000cwb.googlegroups.com...
    > Hi -
    >
    > I have the following code to start a new instance of Powerpoint when
    > the value in Cell A1 is greater than 10:
    >
    > Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
    > Excel.Range)
    >
    > If Range("A1").Value > 10 Then
    > Application.ActivateMicrosoftApp (xlMicrosoftPowerPoint)
    > End If
    >
    > End Sub
    >
    >
    > How can I adapt this code to specify which file to open in Powerpoint?
    > It will always be the same file so I can hard code the filename into my
    > macro, something like 'C:\My Folder\My Presentation.ppt
    >
    > Thanks in advance
    >
    > Jake
    >




  3. #3
    JakeyC
    Guest

    Re: Opening Powerpoint file from Excel

    Thanks for your help.
    That certainly opens Powerpoint but not the actual show, just the
    program. Any ideas why it may not work?


  4. #4
    Bob Phillips
    Guest

    Re: Opening Powerpoint file from Excel

    Do you mean launching into Powerpoint Viewer?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "JakeyC" <mrjsoftware@hotmail.com> wrote in message
    news:1133213544.446734.71060@g14g2000cwa.googlegroups.com...
    > Thanks for your help.
    > That certainly opens Powerpoint but not the actual show, just the
    > program. Any ideas why it may not work?
    >




  5. #5
    JakeyC
    Guest

    Re: Opening Powerpoint file from Excel

    Yes, I'd like it to start the show. I realise my '.ppt' extension was
    misleading - the one I used in the end was '.pps', however both seem to
    launch an empty powerpoint.


  6. #6
    Rowan Drummond
    Guest

    Re: Opening Powerpoint file from Excel

    Hi Jake

    If you set a reference to the Microsoft Powerpoint Object Library then
    you could try it like this:

    Private Sub Workbook_SheetChange(ByVal Sh As Object, _
    ByVal Target As Excel.Range)

    If Range("A1").Value > 10 Then

    Dim ppApp As PowerPoint.Presentation

    Set ppApp = GetObject("C:\temp\pptShow.pps")
    ppApp.SlideShowSettings.Run

    End If
    End Sub

    Hope this helps
    Rowan

    JakeyC wrote:
    > Yes, I'd like it to start the show. I realise my '.ppt' extension was
    > misleading - the one I used in the end was '.pps', however both seem to
    > launch an empty powerpoint.
    >


  7. #7
    Bob Phillips
    Guest

    Re: Opening Powerpoint file from Excel

    Just run the show then, add

    oPPT.SlideShowSettings.Run

    at the end.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "JakeyC" <mrjsoftware@hotmail.com> wrote in message
    news:1133219362.553008.23810@g47g2000cwa.googlegroups.com...
    > Yes, I'd like it to start the show. I realise my '.ppt' extension was
    > misleading - the one I used in the end was '.pps', however both seem to
    > launch an empty powerpoint.
    >




Closed 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