LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Shapes.AddNodes Error on adding next point <0.25 away from pre

Hi,

I tested the following code in Excel 2000. if there are nodes close to
each other then the ConvertToShape method fails. SetPosition and Insert
method work. it also happened in Excel 97. but I don't know if it is
the same in later versions.

Sub Test1()
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 10, 10)
.AddNodes msoSegmentLine, msoEditingAuto, 10.25, 10.25
.AddNodes msoSegmentLine, msoEditingAuto, 10, 10.25
.AddNodes msoSegmentLine, msoEditingAuto, 10, 10
.ConvertToShape.Select ' shows Run time error 1004:
'Application defined or object defined error
End With
End Sub

Sub Test2()
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 10, 10)
.AddNodes msoSegmentLine, msoEditingAuto, 100, 100
With .ConvertToShape
.Nodes.SetPosition 2, 10.25, 10.25
.Nodes.Insert 2, msoSegmentLine, msoEditingAuto, 10, 10.25
.Nodes.Insert 3, msoSegmentLine, msoEditingAuto, 10, 10
End With
End With
End Sub

--
HTH,

okaizawa


Johannes wrote:
Sorry, I mean the var of type freeform builder. Will get the error at the
time I set it to shape (so can be visible on Excel worksheet).
Btw, I'm using Office 2003 with all the patches avail in Windows Update
(more appropriately Office Update).
I went to the link from Nick, it didn't provide answer to my Q.

<CODE
Dim shpMyGreatShape As Shape
Dim ffbMyFreeForm As FreeformBuilder
Set ffbMyFreeForm = ActiveSheet.Shapes.BuildFreeform(msoEditingAuto,
300, 200)
With ffbMyFreeForm
.AddNodes msoSegmentLine, msoEditingAuto, 300.1, 200 'if changed the
X,Y to bigger distance away from 300,200, will NOT get error below
Set shpMyGreatShape = .ConvertToShape 'will get error here
End With
</CODE




 
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
adding formulas to shapes in excel A Excel Discussion (Misc queries) 2 May 15th 23 11:43 AM
Adding only vertical error bars to a single data point in a series Chris Wagner, Northern Michigan Univ. Charts and Charting in Excel 6 May 13th 23 11:44 AM
Adding Shapes to Spreadsheets Buckeye Bill Excel Discussion (Misc queries) 1 May 8th 08 08:17 PM
adding formulas to shapes in excel A Excel Discussion (Misc queries) 0 February 22nd 08 01:14 PM
AddNodes msoSegmentCurve Bubb Excel Discussion (Misc queries) 2 May 3rd 06 06:01 PM


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"