Presentation ReadOnly property error

P

Phil Spiby

I have set up a routine to check when a presentation is being closed, and if
the presentation is not readonly I perform some administrative tasks.
However I have found that this is failing under Powerpoint 10.

The symptoms are:
if I close a non-readonly presentation but leave powerpoint running OK
if I close a readonly presentation but leave powerpoint running
OK
if I close powerpoint with a non-readonly presentation
OK
if I close powerpoint with a readonly presentation
ERROR!

The presentation.readonly value is set to msoFalse, even though the
presentation was opened in readonly mode, my code then tries to perform the
administrative tasks on a file which has been opened in readonly mode.

Private Sub myApp_PresentationClose(ByVal Pres As Presentation)
If ES_template(Pres) Then
If Not Pres.ReadOnly Then
ES_Closing.setPresentation Pres
ES_Closing.Show
End If
End If
End Sub
 
P

Phil Spiby

So no-one on this newsgroup is able to answer this VBA related issue?
If no-one can help me directly is there any web sites or other newsgroups
which people know of that might be able to help me?

Phil
 
S

Steve Rindsberg

It's not very clear from your post what administrative tasks you're
performing.
It might also help to know the specific error you get.

FWIW, I've noticed that PPT may hold various files open long after it's done
with them, which leaves them in a read-only state as far as the OS is
concerned.

--
Posted to news://msnews.microsoft.com
Steve Rindsberg, PPT MVP
PowerPoint FAQ - www.pptfaq.com
PPTools - www.pptools.com
===============================
 
P

Phil Spiby

Steve,

Thanks for responding.
The administrative tasks I am performing are to show a form offering to:
Issue the presentation to our central QA server
Save the presentation
Quit without saving the presentation

I don't actually get an error message, it's just that a presentation which
has been opened as readonly is marked as NOT being readonly during the
PresentationClose event when powerpoint is closed down. It IS marked as
readonly if just that presentation is closed.

Phil
 
S

Steve Rindsberg

Hi Phil.

Let me see if I can simplify/summarize this:

You're trapping the Presentation.Close event
The Presentation.Close event handler tests to see if the presentation is
read-only
If so, it calls another subroutine or two

The Read-Only test returns True if the presentation is read-only and a user
(or code?) closes the presentation, BUT
The Read-Only test erroneously returns False if the presentation is open
when Powerpoint closes.

Is that an accurate explanation of what you're seeing?

Have you put a break in the event handler and traced what happens when you
close PPT?


--
Posted to news://msnews.microsoft.com
Steve Rindsberg, PPT MVP
PowerPoint FAQ - www.pptfaq.com
PPTools - www.pptools.com
===============================
 
P

Phil Spiby

Hi Steve,

Your summary is correct.

I have not been able to put a break into the code as run (since it is loaded
as an add-in), but I have modified the code to use msgbox at a number of
points to give the value of pres.ReadOnly during the execution.
On entry to the routine ReadOnly already has the value msoFalse if
powerpoint is closed and the presentation left open.

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top