Chart Name

Z

Zone

I have an embedded chart on a worksheet. Each time I run my macro, I
delete the existing chart and create it fresh. I would like for its
name to remain Chart 1, but Excel renames it each time it is created,
to something like "Sheet 1 Chart 22". I'm not sure this makes much
difference, but I am curious as to Excel's "memory" of the deleted
charts, and will I run into trouble when I get to chart names like
Sheet 1 Chart 280309387. (Excel 2002)
Thanks, James
 
P

Peter T

The sheet's 'object-counter' increments by one each time you insert any type
of object. The new default name is "object-type object-counter'.

AFAIK the only way to reset the counter is to delete all objects from the
sheet, save and close the file.

I've never had a problem even with the counter over a million, but not
tested to 280 million as it seems you intend to reach!

There might be a potential problem if creating new a object in VBA when the
counter reaches 65536 and in the same code .Select the object even if
there's only one object on the sheet (not sure why). But it's rarely
necessary to select anything in code.

Instead of deleting the chartobject each time why not update its chart.

Regards,
Peter T
 

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