Programming Shapes

G

Gary

I have some code that deletes shapes by selecting individual shapes then
deleting them prior to sending document in an email to another division.
Unfortunately, I found out today that if the shape somehow was deleted, the
macro blows up. I need something like:

If shape exists then
select shape
delete shape
end if

I can't figure out how to determine if the shape exists. Another
possibility, I suppose, is to check for an error on delete, but I'm not sure
how to do this.

Thanks,
Gary
 
D

Don Guillett

You fail to show your code but
on error resume next
or
sub delshps()
for each sh in activeworksheet.shapes
sh.delete
next sh
end sub
 

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