[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

problem with shapes.nodes collection in excel 2007

tpm

12/12/2006 11:04:00 AM

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

3 Answers

tpm

12/12/2006 12:38:00 PM

0

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

tpm@third.com wrote:
> 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

Duncan

12/12/2006 12:53:00 PM

0

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

tpm@third.com wrote:
> 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
>
> tpm@third.com wrote:
> > 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

12/12/2006 1:28:00 PM

0

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


Duncan wrote:
> 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
>
> tpm@third.com wrote:
> > 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
> >
> > tpm@third.com wrote:
> > > 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