Found the bug!

E

Edvado

For those of you that learn from other's mistakes, I got a DOOZY!

I have a PowerPoint presentation in which a user clicks a button on the
toolbar and is shown a user form. On that form they enter a number,
choose an icon, and enter coordinates. They hiot an action button and
the VBA places an icon at that location with a text box grouped to it
containing the number. The whole thing is setup to do as many as 99 of
these actions.

To accomplish this seemingly easy task, the VBA places the icon, and
then names it "icon". It then pastes the text box over it and names it
"text". I then uses the names "icon" and "text" to group the two
together.

All went well until one of my users got a "Run-Time Error '70'
Permission Denied" error.

I first though there was something supernatural going on, because the
DEBUG showed me the VBA line blowing up was where I named the icon
"icon". That didn't match the "Permission Denied" error at all. I
tried to re-create the problem, but failed until this afternoon.

Another user was using the presentation for the first time, and when she
finished her work I asked her what she thought. She told me it went
really well, and she liked the way it worked. I asked her about any
problems, and she said "Oh yeah, I almost forgot to tell you. When I
stopped between placing icons to ungroup one from the text so I could
change it, the program blew up".

See, once she ungrouped it, the names "icon" and "text" were again in
use in the collection. When they were grouped it didn't matter. She
figured out that once she re-grouped the two the VBA worked like a
charm!

The error message was due to trying to name an object in the collection
using a name that was already in use. How I was supposed to get that
from "Run-Time Error '70' Permission Denied" I don't know.

I simply modified the VBA to name the icon with a concatenation of the
user's first number entered and the word "Icon" and something similar
with the text. That made them unique, so it didn't matter if the user
futzed with them.

Talk about needle in a haystack.

-Edvado
 
Top