Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default Bug, multiple selection of shapes

Hi,

I found the following bug, and hope that someone from Microsoft will read
this.

Create two shapes (two rectangles for example), say R1, then R2

If you select R1, then R2, and then run some code to get the name of the
objects:
Set myobj = Selection.Item(1)
MsgBox myobj.Name
Set myobj = Selection.Item(2)
MsgBox myobj.Name
you'll see R1, then R2

If you select R2, then R1, and then run some code to get the name of the
objects:
Set myobj = Selection.Item(1)
MsgBox myobj.Name
Set myobj = Selection.Item(2)
MsgBox myobj.Name
you'll see R2, then R2

I believe this is a bug. If not, sorry.

Regards,

Mr T

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Bug, multiple selection of shapes

When reading multiple objects from the selection at drawingobject level
first time the first object that was selected is returned. Thereafter the
order of objects is sorted into ZOrder's (order on sheet), the original
selection order can no longer be read. If you put a loop in your code you'll
see what I mean.

For i = 1 To 2
Set myobj = Selection(1)
MsgBox myobj.Name, , myobj.ZOrder
Set myobj = Selection(2)
MsgBox myobj.Name, , myobj.ZOrder
Next

In the second loop items will returned in ZOrder

Since XL97 MS suggest always use the Shape/ShapeRange level, although
DrawingObjects and "Rectangle" etc has been maintained for backwards
compatibility (and very useful too).

Start afresh and try

Set myobj = Selection.ShapeRange(1)
MsgBox myobj.Name, , myobj.ZOrderPosition
Set myobj = Selection.ShapeRange(2)
MsgBox myobj.Name, , myobj.ZOrderPosition

Items will be returned in ZOrderPosition regardless of the order they were
selected. So if what you say is a bug, and in a sense it is confusing, it
was fixed a long time ago.

I'm curious, why do people keep posting these bug type suggestions in this
manner before having thrashed it in the ng. Thereafter when people respond
normally the OP doesn't reply.

Regards,
Peter T
"MrT" wrote in message
...
Hi,

I found the following bug, and hope that someone from Microsoft will read
this.

Create two shapes (two rectangles for example), say R1, then R2

If you select R1, then R2, and then run some code to get the name of the
objects:
Set myobj = Selection.Item(1)
MsgBox myobj.Name
Set myobj = Selection.Item(2)
MsgBox myobj.Name
you'll see R1, then R2

If you select R2, then R1, and then run some code to get the name of the
objects:
Set myobj = Selection.Item(1)
MsgBox myobj.Name
Set myobj = Selection.Item(2)
MsgBox myobj.Name
you'll see R2, then R2

I believe this is a bug. If not, sorry.

Regards,

Mr T



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
How do i read Selection.Shapes.Range(Array(i)? Harry Excel Programming 2 September 6th 05 03:46 PM
Selection order problem with code for shapes connection [email protected] Excel Programming 2 August 12th 05 02:03 PM
Programmatically add shapes to a selection Edward Ulle Excel Programming 3 August 8th 05 12:17 AM
Programmatically add shapes to a selection Edward Ulle Excel Programming 0 June 1st 05 08:29 PM
Disable selection of shapes Mike Excel Programming 3 December 17th 03 01:43 PM


All times are GMT +1. The time now is 10:09 PM.

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"