tweedle
Well-known Member
- Joined
- Aug 1, 2010
- Messages
- 1,559
So I'm creating a bunch of shapes via vba that need to maintain their size as created, but allow the user to drag around (move) if need.
I've been digging through shape properties and ShapeNodes but haven't found how to lock the shape from resizing.
I need some direction/examples ... if this is possible.
TIA
I've been digging through shape properties and ShapeNodes but haven't found how to lock the shape from resizing.
I need some direction/examples ... if this is possible.
TIA
Code:
Sub foo()
'basic idea...
vleft = 0
vtop = 0
gwidth = 40
gheight = 40
bwidth = 50
bheight = 50
Set shp1 = ActiveSheet.Shapes.AddShape(msoShapeRectangle, vleft + 5, vtop + 5, gwidth, gheight)
shp1.Fill.ForeColor.RGB = RGB(0, 0, 166)
Set shp2 = ActiveSheet.Shapes.AddShape(msoShapeRectangle, vleft, vtop, bwidth, bheight)
shp2.Fill.ForeColor.RGB = RGB(0, 255, 0)
shp2.ZOrder msoBringToFront
shp2.ZOrder msoSendBackward
Dim shpgrp As Shape
Set shpgrp = ActiveSheet.Shapes.Range(Array(shp1.Name, shp2.Name)).Group
End Sub