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.
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.