View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default Make Drawing Object Unsizeable

Hi Tom,
I think I know what you mean?.....The names of shapes, ranges, or what
ever (can any other objects be named in the Name box?), cannot be
straight deleted using the Name box, they can only be given a new name.
Is this right?
I must admit I became a trifle confused when looking into the use of
the Name box versus InsertNameDefine... in relation to naming a
shape. Say I add a ractangular AutoShape to a sheet, select it then
InsertNameDefine... I see in the Refers to: box = "Rectangle 1". In
the Names in workbook: box I can type a suitable name, which must
follow the Names rules, so I can type (minus the speech marks)
"MyRectangle" but not "My Rectangle". Say I type (minus the speech
marks) "MyRectangle" then click AddOK. Then, in the Name box, with
that rectangle still selected, I still see "Rectangle 1". Furthermore,
I can click in the Name box and change it to (minus the speech marks)
"My Rectangle". Now, if I go InsertNameDefine... I see in the Refers
to: box ="My Rectangle". Also, If I use the Name box to name more than
one shape, I never see a list of the named shapes when I click on the
Name box's drop down arrow, just a list of the named ranges.
All that I can conclude from this is that the name I used in the Name
box ("My Rectangle" ie with the space) is not really a name, since...
1) it violates Excel's naming rule and...
2) when you click on the Name box's drop down arrow you don't see a
list of all the named shapes, only a list of named ranges.
So, if I'm correct, and it isn't a name then what should I call it?

Also, say I want to write code to manipulate a shape on Sheet1 that I
have "named" via the Name box "My Rectangle" and I want to give
it a completely different variable name, say "Oblong" then I would
write...

Dim Oblong as Shape
Set Oblong = Sheet1.Shapes("My Rectangle")
rest of code...

now how would I write code to set Oblong using the "real" name if I
had named the shape MyRectangle using InsertNameDefine...?

Ken Johnson