+ Reply to Thread
Results 1 to 2 of 2

Check if PPT is OPEN and if not open PPT

  1. #1
    Registered User
    Join Date
    12-28-2005
    Posts
    21

    Check if PPT is OPEN and if not open PPT

    Hello. I have the following code which opens a PPT from Excel. The code works, however, if the file is already open, the macro will reopen the PPT as a read only. Can someone please help me add code that looks to see if file is already open? If it is, I'd like a msgbox that say "file already open". I tried some combinations but didn't work. The following code just opens file. Thanks!

    Sub OpenPPTX_File()

    Dim PowerPointApp As Object

    Dim Directory As String
    Dim PPTFile As String

    Directory = Range("Input_PPTFileDir")
    PPTFile = Range("Input_PPTFileNm")

    Set PowerPointApp = CreateObject("PowerPoint.Application")
    PowerPointApp.Presentations.Open (Directory & PPTFile)
    PowerPointApp.Visible = True

    End Sub

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Check if PPT is OPEN and if not open PPT

    Please Login or Register  to view this content.
    Last edited by humdingaling; 06-29-2017 at 10:46 PM. Reason: Simplified code
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA UserForm.Value Check If User Form Buttons checked Not Working. Check Button on Open.
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-11-2016, 05:55 PM
  2. [SOLVED] Check to see if IE is open (regardless of how many folders are open)
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2014, 07:11 AM
  3. Open Workbook if closed, keep open if open, insert password
    By jwahl16 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-09-2013, 04:09 PM
  4. Check if a Word File is Open and If Open Close it with Excel VBA.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2012, 11:14 AM
  5. Check if file is open and open if closed
    By Jockster in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-22-2010, 08:18 AM
  6. Check to see if file is open, and if it is open, activate it
    By karen000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2009, 03:59 AM
  7. [SOLVED] vba to check presence of file and open/not open
    By fLiPMoD£ in forum Excel General
    Replies: 2
    Last Post: 04-28-2005, 04:06 PM

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