How to delete or unlock a shape that's "locked for selection"

D

Dave Jenkins

I have a user that has created a PPT file that contains shapes that cannot be
accessed. Any attempt to even reference the shapes with a statement such as
oSl.shapes(n) (where 0<n<=number of shapes on the slide) results in runtime
error 440.

I can use ONERROR to trap such errors and report that these locked shapes
exist, but I'd like to delete them or otherwise change their properties such
that they don't cause the runtime error when I'm processing all the shapes on
a slide.

Go here: http://www.mediafire.com/?aajaa0htaaj for a file that exhibits the
problem I'm talking about. Note that an error will occur attempting to
access the shapes on the second slide, but only if the first slide is
present. Note also that the error will not occur if the order of the slides
is reversed.

Here is some code which you can use to access all the shapes on a slide:

Sub test()
Dim oSl As Slide
Dim oSh As Shape
dim i as integer

on error goto badShape
For Each oSl In ActivePresentation.Slides
for i = 1 to osl.shapes.count
set oSh = oSl.Shapes(i)
nextShape:
Next i
Next
End Sub

badshape:
resume nextShape

Can anybody shed some light on this frustrating siutation? Could it have
something to do with slide master, perhaps?

Thanks.
 

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