Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

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
Row Height stopped growing and Auot-Fit Row Height does not work PSULionRP Excel Discussion (Misc queries) 0 May 19th 09 07:59 PM
Shape Height Goes Down! Jason Morin Excel Programming 12 June 27th 07 02:19 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Deleting a shape and the cell contents the shape is in. Dave Peterson[_3_] Excel Programming 1 October 9th 03 03:36 PM
Deleting a shape and the cell contents the shape is in. Tom Ogilvy Excel Programming 0 October 9th 03 03:43 AM


All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"