Thread: Height of shape
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder Rob van Gelder is offline
external usenet poster
 
Posts: 37
Default Height of shape

I'm betting you haven't posted all of the code, because sh.height is referenced before sh is set!

nextTop = nextTop + sh.Height + 5
Set sh = chForStore.Shapes.AddTextbox(msoTextO ...

Cheers,
Rob


ojv wrote:
m adding a number of shapes to a chart sheet using the using the the
Shape.Height property for relative positioning. The code I use work well with
Excel 2003 but fail utterly in Excel 2007 - always returning zero for height.
The shapes then appear on top of each other giving a rather cluttered
appearance. Any aid to why the height property returns zero in Excel 2007
would be greatly appreciated. Code snippet:

nextTop = 5
left = 5
For i = LBound(projectInfo, 2) To UBound(projectInfo, 2)
nextTop = nextTop + sh.height + 5
Set sh = chForStore.Shapes.AddTextbox(msoTextOrientationHor izontal,
left, nextTop, 0#, 0#)
Set sh = chForStore.Shapes(chForStore.Shapes.count)
With sh
.Select
Selection.AutoScaleFont = False
.TextFrame.Characters.Text = projectInfo(0, i) & " " &
projectInfo(1, i)
.TextFrame.Characters.Font.size = 10
.TextFrame.AutoSize = msoTrue
.Placement = xlFreeFloating
End With
Next