PDA

View Full Version : Re-setting Checkbox Number



mferrisi
03-30-2007, 08:14 AM
When I create checkboxes in the following method, they are assigned a number before I re-name them. The program is run frequently, and even when the program is closed, the assigned numbers are not reset to one. (RIght now, the new box is assigned "Check Box 5403) Is there a way to reset them so that when I open the program, the numbers start at one again?

Thank you,
Matt

With Worksheets(1).Shapes.AddFormControl(xlCheckBox, 270, 285 + (add Shapes) * 16, 100, 10)
.Name = "cbx" & InitialShapes + addShapesShapes) * 16, 100, 10)

lucas
03-30-2007, 08:27 AM
one of the many problems you will run into when creating controls on the fly....

Bob Phillips
03-30-2007, 08:39 AM
I thought I showed you a way in a previous thread.

mferrisi
03-30-2007, 11:38 AM
Thanks for the response. Maybe I am not understanding your previous post, but I am able to rename the check boxes just fine. However, before I do, Excel nitiall assigns them a default value that never seems to reset (and is now at about 6,000.) This isn't a problem since I create them immediately rename, but it might make something easier in the future if I can really reset the page, including the check box default numbers. (If it makes a difference, the page contains five permanent shapes that do not get deleted on each run of the program, and they were the originally named Check Box 1-5)

Thank you for your help,

Matt

Bob Phillips
03-30-2007, 12:56 PM
That is within the bowels of Excel, somewhere that is not exposed to VBA. The best we can do is control what they are named.