Programming PowerPoint using VBA

C

Clifton Ivey

I have been working on a project where I need to add some shapes to a
presentation using VBA. Of course I run the code as I test many times and
each time I do notice the shapes just keeping getting added to the slides.

What I don't understand is why the objects I am adding persist after the
slide show is no longer executing. They even remain part of the presentation
when I close and reopen it. Why is that? I haven't even saved the
presentation.

I know I am missing something fundamental here, but it has been difficult to
find a resource on the Net to explain away my confusion.
 
J

John Wilson

If you add shapes in vba it's the same as adding manually in edit mode. ie
they stay added unless you delete them.

To avoid adding "duplicates" you could do a check in vba that the shape
doesn't exist or first delete it (trapping any error if it's not there) and
then add it. You would need to name or tag it to do this.

You might also run a routine to globally remove them all at the end of the
presentation.
 
C

Clifton Ivey

Hello Steve and John,

Thanks for your help. I suspected something along the lines of your
explanation.

Steve: I double-checked what I told you about the form saving automatically
and I was mistaken. I must've chosen to save the form when prompted on exit.

Again, thanks for your help.

C. Brian Ivey
 

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