ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   freeformbuilder (https://www.excelbanter.com/charts-charting-excel/137612-freeformbuilder.html)

boyze

freeformbuilder
 
I'm a newbie trying to build a freeform shape by adding nodes via .addnodes
via a loop.

Something like:
'
Count = UBound(CoordArray, 1)
'
With myDocument.Shapes.BuildFreeform(msoEditingCorner, CoordArray(1, 1),
CoordArray(1, 2))
For counter = 1 To Count
.AddNodes msoSegmentLine, msoEditingAuto, CoordArray(counter, 1),
CoordArray(counter, 2)
Next counter

.ConvertToShape

End With


But it doesn't like this.
--
thanks for your help.

jap

Andy Pope

freeformbuilder
 
Hi,

The problem is, assuming your CoordArray values are valid, the first value
in the for next loop is the same as the start point.
Try this,

For counter = 2 To Count

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"boyze" wrote in message
...
I'm a newbie trying to build a freeform shape by adding nodes via
.addnodes
via a loop.

Something like:
'
Count = UBound(CoordArray, 1)
'
With myDocument.Shapes.BuildFreeform(msoEditingCorner, CoordArray(1,
1),
CoordArray(1, 2))
For counter = 1 To Count
.AddNodes msoSegmentLine, msoEditingAuto, CoordArray(counter, 1),
CoordArray(counter, 2)
Next counter

.ConvertToShape

End With


But it doesn't like this.
--
thanks for your help.

jap



boyze

freeformbuilder
 
Thanks. Worked like a charm.
--
X


"Andy Pope" wrote:

Hi,

The problem is, assuming your CoordArray values are valid, the first value
in the for next loop is the same as the start point.
Try this,

For counter = 2 To Count

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"boyze" wrote in message
...
I'm a newbie trying to build a freeform shape by adding nodes via
.addnodes
via a loop.

Something like:
'
Count = UBound(CoordArray, 1)
'
With myDocument.Shapes.BuildFreeform(msoEditingCorner, CoordArray(1,
1),
CoordArray(1, 2))
For counter = 1 To Count
.AddNodes msoSegmentLine, msoEditingAuto, CoordArray(counter, 1),
CoordArray(counter, 2)
Next counter

.ConvertToShape

End With


But it doesn't like this.
--
thanks for your help.

jap




All times are GMT +1. The time now is 04:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com