Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Shape.ID is it unique - when is it set - when does it change

Hi

I would like a way to uniquely identify shapes within a workbook. Is the ID
property of Shape unique? Is it only assigned when the shape is created? Is
there any other way it can be changed? I'm trying to make sure that it is a
good property to use as a unique identifier. Thanks,

Dave
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Shape.ID is it unique - when is it set - when does it change


Select the shape and look in the name box to the left of the formula box. Go
there and change the name to whatever desired and touch the enter key.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"lahd" wrote in message
...
Hi

I would like a way to uniquely identify shapes within a workbook. Is the
ID
property of Shape unique? Is it only assigned when the shape is created?
Is
there any other way it can be changed? I'm trying to make sure that it is
a
good property to use as a unique identifier. Thanks,

Dave


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Shape.ID is it unique - when is it set - when does it change

Yes, that is the problem. I'm doing this programmatically and I want a
unique identifier for the shape. Is the ID property of the Shape object
unique? The name is not and can be set by the user...


"Don Guillett" wrote:


Select the shape and look in the name box to the left of the formula box. Go
there and change the name to whatever desired and touch the enter key.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"lahd" wrote in message
...
Hi

I would like a way to uniquely identify shapes within a workbook. Is the
ID
property of Shape unique? Is it only assigned when the shape is created?
Is
there any other way it can be changed? I'm trying to make sure that it is
a
good property to use as a unique identifier. Thanks,

Dave



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Shape.ID is it unique - when is it set - when does it change

AFAIK the shape's ID property is unique within the workbook and remains
constant while on its original sheet. A new shape will not be given the same
ID of some deleted shape

You can't directly refer to a shape by it's ID property, would need to loop
something like this

For each shp in Activesheet.shapes
If shp.ID = 1234 then
bFound = True
Exit For
Next
If bFound then
Msgbox shp.name
End If

The shape ID property is n/a in older Excel versions, I think introduced in
XP

Regards,
Peter T


"lahd" wrote in message
...
Yes, that is the problem. I'm doing this programmatically and I want a
unique identifier for the shape. Is the ID property of the Shape object
unique? The name is not and can be set by the user...


"Don Guillett" wrote:


Select the shape and look in the name box to the left of the formula box.
Go
there and change the name to whatever desired and touch the enter key.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"lahd" wrote in message
...
Hi

I would like a way to uniquely identify shapes within a workbook. Is
the
ID
property of Shape unique? Is it only assigned when the shape is
created?
Is
there any other way it can be changed? I'm trying to make sure that it
is
a
good property to use as a unique identifier. Thanks,

Dave





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Shape.ID is it unique - when is it set - when does it change

Thank you that is what I needed to know and plan to do.


"Peter T" wrote:

AFAIK the shape's ID property is unique within the workbook and remains
constant while on its original sheet. A new shape will not be given the same
ID of some deleted shape

You can't directly refer to a shape by it's ID property, would need to loop
something like this

For each shp in Activesheet.shapes
If shp.ID = 1234 then
bFound = True
Exit For
Next
If bFound then
Msgbox shp.name
End If

The shape ID property is n/a in older Excel versions, I think introduced in
XP

Regards,
Peter T


"lahd" wrote in message
...
Yes, that is the problem. I'm doing this programmatically and I want a
unique identifier for the shape. Is the ID property of the Shape object
unique? The name is not and can be set by the user...


"Don Guillett" wrote:


Select the shape and look in the name box to the left of the formula box.
Go
there and change the name to whatever desired and touch the enter key.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"lahd" wrote in message
...
Hi

I would like a way to uniquely identify shapes within a workbook. Is
the
ID
property of Shape unique? Is it only assigned when the shape is
created?
Is
there any other way it can be changed? I'm trying to make sure that it
is
a
good property to use as a unique identifier. Thanks,

Dave







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can one change shape properties conditionally? Bob Arnett Excel Worksheet Functions 1 June 17th 09 04:14 AM
Change Shape Text rhani111 Excel Worksheet Functions 2 July 14th 06 02:31 PM
change shape by condition Libramanuk Excel Discussion (Misc queries) 2 March 21st 06 02:51 PM
Change Shape Name dthmtlgod Excel Programming 1 January 11th 06 06:08 PM
How to change shape of points in chart? Simon Reed Charts and Charting in Excel 1 August 10th 05 01:08 PM


All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"