Grouped Shapes VBA

IGWright

New Member
Joined
Apr 15, 2007
Messages
40
Hello Everyone!

I've searched high and low for an answer on this, and still can't quite make it work.

I have a Workbook with many Grouped shapes. One of the problems I've been having is that when I change the focus of the Worksheet, the size of the Shapes change by increments. This seems to be some kind of flaw with the program.

It's not a big deal since the changes are small, but I've been looking into a code based solution. What I've got so far is:

Sub Shapes()
If Shape.Name = "Top" Then
.LockAspectRatio = msoFalse
.Height = 13
.Width = 13
.LockAspectRatio = msoTrue
End If
End Sub

In this case there are several Shapes named "Top". They are all Grouped. The Height and Width are supposed to be 0.18" and I find that if I set the .Height and .Width to 13, it sets those parameters to 0.18".

I can get this code to work for one Shape, but not multiple.

Any help here would be appreciated.

Thank-you,


Ian
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
My experience with 2007 is that the AutoShapes change size arbitrarily. You can set the size of a shape, close the Workbook, re-open the Workbook and the shape has changed size. Oops.
It is not reproduced on my PC. As far as I know such behavior has been fixed in SP2 for Excel 2007.
 
Last edited:
Upvote 0
It is not reproduced on my PC. As far as I know such behavior has been fixed in SP2 for Excel 2007.

And I do have SP2 installed. The only thing I can think of is the possibility that having shapes with the same name produces this side effect.


Ian
 
Upvote 0

Forum statistics

Threads
1,221,479
Messages
6,160,073
Members
451,616
Latest member
swgrinder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top