p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Excel VBA (http://p2p.wrox.com/forumdisplay.php?f=79)
-   -   drawing with VBA (http://p2p.wrox.com/showthread.php?t=9474)

cutovoi February 17th, 2004 02:10 PM

drawing with VBA
 
How can I draw a rectangle in VBA?


virtualdave February 19th, 2004 07:22 PM

You'll have to instance and work with the line object. Something like this:
    With myWS
        'Draw the distance axis
        With .Shapes.AddLine(Xmin, Ymin, Xmin, Ymax).Line
            .EndArrowheadStyle = msoArrowheadTriangle
            .EndArrowheadLength = msoArrowheadLengthMedium
            .EndArrowheadWidth = msoArrowheadWidthMedium
            .Weight = 3#
        End With
    End With
will draw a single line that has an arrow head. You will need to pass it the four points to draw your rectangle. You could also use a polyline or "shape" and pass its ordinates.

Dave


All times are GMT -4. The time now is 10:32 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.