Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Freeform Object Failing

I am using VBA in Excel to draw freeform objects from arrays of data that are
supplied by the active worksheet:

With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, thePoly(1, 1),
thePoly(2, 1))
For i = 2 To NP
.AddNodes msoSegmentLine, msoEditingAuto, thePoly(1, i),
thePoly(2, i)
Next i
.ConvertToShape.Select
End With

Very simple. The problem is that every now and then the
".ConverToShape.Select" line fails with Run Time Error '1004', which doesn't
tell me much. I look at the points in the "thePoly" array, and they look
fine. Does anyone know what can cause this failure to occur?

Thanks,

Eric
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Freeform Object Failing


I'd get rid of the Select method. Instead of

..ConvertToShape.Select

just use

..ConvertToShape

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Thu, 6 Nov 2008 14:19:01 -0800, egun
wrote:

I am using VBA in Excel to draw freeform objects from arrays of data that are
supplied by the active worksheet:

With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, thePoly(1, 1),
thePoly(2, 1))
For i = 2 To NP
.AddNodes msoSegmentLine, msoEditingAuto, thePoly(1, i),
thePoly(2, i)
Next i
.ConvertToShape.Select
End With

Very simple. The problem is that every now and then the
".ConverToShape.Select" line fails with Run Time Error '1004', which doesn't
tell me much. I look at the points in the "thePoly" array, and they look
fine. Does anyone know what can cause this failure to occur?

Thanks,

Eric

Reply
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
Extracting values from Freeform shapes RockVol11 Excel Programming 4 June 24th 08 05:50 PM
Area of freeform shapes Dave Shaw Excel Programming 15 January 4th 08 06:14 PM
copy method of object failing vj2india Excel Programming 0 April 20th 06 02:21 AM
Pick list or freeform text PJH Excel Discussion (Misc queries) 2 March 30th 06 05:11 AM
Freeform shapes Jackie[_5_] Excel Programming 2 June 8th 05 05:40 PM


All times are GMT +1. The time now is 05:17 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"