Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
activesheet.OleObjects(1).Chart.Name = "Chart 1"
-- Regards, Tom Ogilvy "Zone" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Zone" wrote in message oups.com... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks, Tom and Peter. James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to change position of chart labels on line chart | Charts and Charting in Excel | |||
Change Chart Properties for Multiple Chart Shts using a Worksheet | Charts and Charting in Excel | |||
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard | Charts and Charting in Excel | |||
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard | Setting up and Configuration of Excel | |||
Excel 2003: How to nudge a chart element or shape on a chart? | Charts and Charting in Excel |