Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Height of shape
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Row Height stopped growing and Auot-Fit Row Height does not work | Excel Discussion (Misc queries) | |||
Shape Height Goes Down! | Excel Programming | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |