Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2006

Tip: Looking for answers? Try searching our database.

problem with shapes.nodes collection in excel 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tpm@third.com - 12 Dec 2006 11:03 GMT
Hi,

Has anyone come across the following problem? The code below works fine
with Excel 2003, but in 2007 nodes.count always returns zero. Any hints
appreciated!

Many thanks,
Tim

   Dim o As Shape
   For Each o In ActiveSheet.Shapes
       If o.Type = msoLine Then
           If o.Nodes.Count >= 2 Then
                ..etc
tpm@third.com - 12 Dec 2006 12:38 GMT
To clarify further, if I run the following from VBA in a clean Excel
2007 worksheet it still returns 0 instead of 2.

dim o as Shape
set o=ActiveSheet.shapes.addline (0,0,400,400)
? o.Nodes.Count
0

> Hi,
>
[quoted text clipped - 10 lines]
>             If o.Nodes.Count >= 2 Then
>                  ..etc
Duncan - 12 Dec 2006 12:53 GMT
Hi Tim,

I ran this on 2002 SP3 and got a count of 2, so unsure why in 2007 it
would return 0. Is it to do with how you are calling the count? Have
you tried parsing it to a cell?

Regards

Duncan

> To clarify further, if I run the following from VBA in a clean Excel
> 2007 worksheet it still returns 0 instead of 2.
[quoted text clipped - 18 lines]
> >             If o.Nodes.Count >= 2 Then
> >                  ..etc
tpm@third.com - 12 Dec 2006 13:27 GMT
Thanks for the reply - wasn't sure though what you meant by "parsing it
to a cell"?

Incidentally, I just tried doing exactly the same in Word 2007 and in
this environment everything behaves as it should. This seems to confirm
that its an Excel 2007 bug. Any ideas

   Dim o as shape
   set o= ActiveDocument.shapes.addline (0,0,400,400)
   ? o.Nodes.Count
   2

Regards,
Tim

> Hi Tim,
>
[quoted text clipped - 28 lines]
> > >             If o.Nodes.Count >= 2 Then
> > >                  ..etc
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.