verifying an object exists

  • Thread starter Thread starter JT
  • Start date Start date
J

JT

I have a macro with two rectangles that I use as
pushbuttons on a worksheet. Each one has a unique macro
assigned to it.

Macro # 2 makes a copy of the activeworkbook and deletes
the rectangle assigned to Macro # 2 (on the saved copy).
I don't want users to have the option of making another
copy from the "saved" copy.

No problem, so far. However when I open the "saved" copy,
Macro # 1 is used to make a copy of the data and send as
an e-mail attachment. It also deletes the 2 rectangles.

However, if I try to run Macro # 1 (from the "saved" copy,
I get an error because it is trying to delete the second
rectangle (which has already been deleted when the
workbook is copied.)

If Macro # 1 is run from the original workbook, no problem
because both rectangles still exist.

Any suggestions on code to verify the existance of
rectangle 2 would be appreciated.

As always, thanks for the help.
 

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

Back
Top