Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I have a program that (as part of an animation involving vectors in a plane) creates then deletes a large number of arrows on a chart. It works fine, but when I click on one of the arrows I see that its name is something like "Line 5265" even though there are only 2 vectors actually in existence (so that myChart.Shapes.Count correctly gives 2). It seems weird that the Count property is reset upon delete but that there is some behind-the-scenes counter which isn't reset. This isn't pressing since I don't use the name in my code (and know how to change it if I needed to - which, by the way, doesn't reset this hidden counter either) but have a concern that maybe the code will crash after 65536 lines have been created (and mostly deleted) since for all I know there is a 16-bit int counter in the code for Excel which will trigger a bug upon overflow. Is there any way to reset the numbering so that the default numbering of a new shape only depends on the current count? Also- is there anything behind my fear that eventually such large numbers in the shape name might lead to a harmful overflow? Just curious. -scattered |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is a lot of lines. I just tried creating and deleting about
70,000 lines on a worksheet. I left the last 3 lines and they indeed have names of "Line 70004" and the like. The shapes.count is only 3, however, and it did not crash. I am using Excel 2003. You can also change the "name" property by just setting it like this: Dim sLine As Shape sLine.Name = "Line " & lCount Just don't try to set the name to the same name as another object. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reseting to 0. | Excel Discussion (Misc queries) | |||
Did I stump everyone? Counter that ignores hidden rows | Excel Discussion (Misc queries) | |||
Creating a counter that does not include hidden rows | Excel Discussion (Misc queries) | |||
Reseting Shape counter | Excel Programming | |||
Reseting Shape counter | Excel Programming |