flip an autoshape using VBA- recorded macro doesn't work

K

Keith R

I have a shape (block arrow) that I need to flip using VBA.

I recorded the action using macro recorder and got:

Sheet1.Shapes("AutoShape 17").Select
Selection.ShapeRange.Flip msoFlipVertical

When I run these two lines in a sub all by themselves, it works and the
arrow flips. When I use the same two lines embedded in code, I get: "does
not support this property or method" error 438

If OldArrowDir <> ArrowDir Then
Sheet1.Shapes("AutoShape 17").Select
Selection.ShapeRange.Flip msoFlipVertical
Sheet1.Range("C7").Value = ArrowDir
End If


running in debug, it does hit each line, and it is crashing on the line:
Selection.ShapeRange.Flip msoFlipVertical


any ideas?
much thanks,
Keith
 

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