PowerPoint VBA: The Item with the Specified Name Wasn't Found

G

Gene Belknap

When programming in PPT VBA, on an intermittent basis, I
get the above listed error message when attempting to set
a reference to an object on a slide using the object's
name.

For example:
1) Add a new rectangle to the slide and select it
2) Store the rectangle's name in a string variable (e.g.
strName = activewindow.selection.shaperange.name)
3) At some later point, attempt to set a reference to that
rectangle using "set shpNew =
activewindow.selection.sliderange.shapes(strName)"

Most of the time, this works fine. Sometimes, however,
the "set" will fail with the error mentioned in the
subject line even though when you select the object and
look at its name it is clearly the same value as that
stored in your variable.

Any ideas?

NOTE: Exiting and restarting PPT usually (though not
always) solves this problem.
 
A

anna

Try reinstalling PPT/Office...
These are the symptions of some or the other DLL spoiled...

Try this I'm not sure...

Also recreate the whole project afresh(create another
project)and add your source files to newly created project
with appropriate references again...
 

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