Results 1 to 12 of 12

Thread: Open Powerpoint within a specified Window in Excel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,954
    Location
    For my method, you will need to add the Powerpoint object in Tools, References.
    Sub Test_run_ppt_file()    
        run_ppt_File ThisWorkbook.Path & "\TestpptShow.ppt"
    End Sub
     
    Public Function run_ppt_File(PptName As String, Optional tfRun As Boolean = True, _
      Optional ShowType As Integer = 1000, _
      Optional AppWindowstate As Integer = ppWindowMinimized) As Boolean
         'Requires Tools > References... > Microsoft Office PowerPoint xx.0 Object Library
        Dim pPT As New PowerPoint.Application
        Dim pPTopen As PowerPoint.Presentation
        If Dir(PptName) = "" Then Exit Function
         'Set pPT = New PowerPoint.Application
        Set pPT = CreateObject("Powerpoint.Application")
        pPT.Windowstate = AppWindowstate
        Set pPTopen = pPT.Presentations.Open(PptName, , , msoFalse)
        If tfRun = False Then Exit Function
        With pPTopen.SlideShowSettings
          .ShowType = ShowType  'ppShowTypeWindow=2
          With .Run
            .Left = 100
            .Top = 50
            .Width = 400
            .Height = 400
          End With
        End With
    As I explained before, you might want to consider the current resolution. John Walkenbach shows 2 methods on his site. http://spreadsheetpage.com/index.php...eo_resolution/
    Last edited by Kenneth Hobs; 10-31-2017 at 04:58 PM.

Posting Permissions

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