LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Shape top position in Excel 2007

I have an macro to paste shapes onto a worksheet and position them
relative to particular rows. It works fine until tested on a clients
machine running Vista and Excel 2007 when the vertical screen position
of a shape and the range that it sits on are diverging. The left
property is working as expected.

On my clients system, when a shape is placed over a cell, say B600,
and selected, then this test macro is run the highlight cells appear
several rows below the shape.

When the top property reaches 9000 the discrepancy is approximately
160.

I don't have access to another machine running Excel 2007 and I'm
wondering if this is an Excel 2007 'feature' or is it my clients
machine?

Sub test4()
On Error Resume Next
nn = Selection.Name
Set snn = ActiveSheet.Shapes(nn)
ott = snn.Top
oll = snn.Left
ohh = snn.Height
On Error GoTo 0
crr = 0
For r = 1 To 1000
If Cells(r, 2).Top = ott Then
crr = r - 1
r = 1000
End If
Next r
If crr = 0 Then Exit Sub

Range(Cells(crr, 1), Cells(crr, 4)).Interior.ColorIndex = 22

ctt = Cells(crr, 2).Top
msg = nn _
& vbCrLf & "row = " & crr _
& vbCrLf & "row top = " & ctt _
& vbCrLf & "shape top = " & ott _
& vbCrLf & "shape height = " & ohh
MsgBox msg
Range(Cells(crr, 1), Cells(crr, 4)).Interior.ColorIndex = xlNone
ActiveSheet.Shapes(nn).Top = ott + 10
End Sub


Chris Bruce
 
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
How to add pattern to the shape styles for charts in Excel 2007 Galina Charts and Charting in Excel 2 December 13th 07 11:10 AM
Autosize bug in Excel 2007 shape textframes Anthony Berglas Excel Programming 8 May 13th 07 05:53 AM
Autosize bug workarounds in Excel 2007 shape textframes Anthony Berglas Excel Programming 0 April 25th 07 07:36 AM
Position the shape JE McGimpsey Excel Programming 2 January 18th 07 09:34 AM
shape runtime error 438 excel 2007 wolmFromAustria Excel Programming 2 December 10th 06 02:32 PM


All times are GMT +1. The time now is 03:00 AM.

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"