Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2006, 11:57 AM
Authorized User
 
Join Date: Mar 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete object shape name

How do I delete a shape object? Here's the skinny. Let's say I have three Rectangle shape objects on sheet1 which I have added. Each having a text name of shape1 shape2 & shape3. I believe Excel uses a different naming scheme like ... Rectangle 1, Rectangle 2 & Rectangle 3.
When I programmatically delete the shapes, I have to reference the shape names as Rectangle 1,2 or 3 which works! I see when the shapes are deleted. However, If I create three more shape of the same type(rectangle) and want to delete them, I can no longer reference them as Rectangle 1,2 or 3. I have to use Rectangle 4,5 or 6. This leads me to believe that I only graphically deleted the shapes but not the shape names from Excel's shape name counter(or what ever is keeping count of the number of shape(types) created). So more specifically, how do I programmatically delete a shape name such that when I create another shape object of the same type, Excel begins to count it as... for example, Rectangle 1 again? Any ideas?







Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Custom Property to Visio 2003-Shape object ashu_from_india Pro VB 6 3 November 5th, 2008 04:21 AM
ado shape syntax sunpalozzi SQL Language 0 November 2nd, 2006 04:43 PM
Rotating shape in VBA (not center of shape) Piblon Excel VBA 3 April 13th, 2006 04:04 AM
Transform Shape and BPEL ahtisham_a Biztalk 0 November 27th, 2004 11:20 AM
Shape My Command-Please btpoole VB Databases Basics 0 March 7th, 2004 12:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.