Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / May 2008

Tip: Looking for answers? Try searching our database.

VBA - checking if a presentation is already open

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
simonc - 22 May 2008 11:00 GMT
I'm writing a macro which needs to create an instance of powerpoint if there
isn't one, then open a selected presentation if it isn't already open. I've
managed the first bit ok, but I'm not sure how to test if the presentation I
want to use the macro on is already open. The presentation has been selected
using a GetOpenFilename dialogue box so its full file pathname is in a string
variable.

Grateful for advice.
John Wilson - 22 May 2008 13:27 GMT
Can you not loop through all open presentations and check the .fullname
property against the path to your target file?

Something like:

Dim opres as Presentation
For each opres In Application.Presentations
If opres.FullName = "xyz" Then msgbox "It's open"
Next opres

(Air code I haven't tried this!)
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

> I'm writing a macro which needs to create an instance of powerpoint if there
> isn't one, then open a selected presentation if it isn't already open. I've
[quoted text clipped - 4 lines]
>
> Grateful for advice.
simonc - 22 May 2008 14:16 GMT
Thank you for this. It was so simple somehow I couldn't see it.

I have another query:

I have successfully referenced Microsoft Excel to be able to use
GetOpenFileName (I'm still using Office 2000). When I use this in an Excel
macro it remembers the last folder I opened with the macro, but in this
Powerpoint macro it doesn't, and defaults to the My documents folder. Is
there something else I need to do to get the macro to remember the last
folder?

Many thanks

> Can you not loop through all open presentations and check the .fullname
> property against the path to your target file?
[quoted text clipped - 22 lines]
> >
> > Grateful for advice.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.