Trouble positioning an autoshape object using .Top in Excel 2007

M

Michael

I wrote a macro in Excel 2003 that places an Autoshape objects at the top of
each row and then moves on to the next row. This has worked fine in 2003 but
our office is slowly migrating to 2007 and the template is having problems.

When the same macro is run using Excel 2007, line by line, the objects
appear to creap high and higher in the row to the point where they start
looking to be start in the row above them. Has something changed in Excel
2007 that would prevent this 2003 functionality from working in 2007?

Sample Code:
Do While bGenericContinue = True
nProjectedBarLeft = 135
nProjectedBarTop = Cells(iTgtRowNum, 1).Top
nProjectedBarWidth = 245
nBarHeight = Cells(iTgtRowNum, 1).Height
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle,
nProjectedBarLeft, nProjectedBarTop, nProjectedBarWidth, nBarHeight).Select
iTgtRowNum = iTgtRowNum + 1
If iTgtRowNum >= 25 Then
bGenericContinue = False
End If
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top