PC Review


Reply
Thread Tools Rate Thread

ActiveChart.SeriesCollection(1).Points(3).Select ERROR

 
 
SpeeD72
Guest
Posts: n/a
 
      2nd Nov 2007
Hi.

I need to apply the same color to the bars in a graph (via VBA),
wether the graph has 3 bars or 7 bars.

The problem that i face is that when the point (bar) doens´t exists
excel gives back an error:
ActiveChart.SeriesCollection(1).Points(3).Select in case of poínt 3
dont exists.

Is there a way to teste if the point exists, to only apply the
programing in that case?

Thanks a lot!!!

Jorge

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      2nd Nov 2007
Would something like:

ActiveChart.SeriesCollection(1).Points.Interior.ColorIndex = 3

Not work?

"SpeeD72" wrote:

> Hi.
>
> I need to apply the same color to the bars in a graph (via VBA),
> wether the graph has 3 bars or 7 bars.
>
> The problem that i face is that when the point (bar) doens´t exists
> excel gives back an error:
> ActiveChart.SeriesCollection(1).Points(3).Select in case of poÃ*nt 3
> dont exists.
>
> Is there a way to teste if the point exists, to only apply the
> programing in that case?
>
> Thanks a lot!!!
>
> Jorge
>
>

 
Reply With Quote
 
SpeeD72
Guest
Posts: n/a
 
      2nd Nov 2007
Hi.
every bar has is how color. I can make every one with the same color.

Is there a way to teste if the point exists, to only apply the
programing in that case?

Thnks
Jorge

 
Reply With Quote
 
Andy Pope
Guest
Posts: n/a
 
      3rd Nov 2007
Hi,

You can use the Count property to tell you how many points a series has.

ActiveChart.SeriesCollection(1).Points.Count

Cheers
Andy

SpeeD72 wrote:
> Hi.
> every bar has is how color. I can make every one with the same color.
>
> Is there a way to teste if the point exists, to only apply the
> programing in that case?
>
> Thnks
> Jorge
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      3rd Nov 2007
The code will run more smoothly if instead of using

ActiveChart.SeriesCollection(1).Points(3).Select
Selection.Interior.Blah

you use

ActiveChart.SeriesCollection(1).Points(3).Interior.Blah

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Andy Pope" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> You can use the Count property to tell you how many points a series has.
>
> ActiveChart.SeriesCollection(1).Points.Count
>
> Cheers
> Andy
>
> SpeeD72 wrote:
>> Hi.
>> every bar has is how color. I can make every one with the same color.
>>
>> Is there a way to teste if the point exists, to only apply the
>> programing in that case?
>>
>> Thnks
>> Jorge
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-Time Error 1004 on ActiveChart.SeriesCollection(1).Values = jparnold Microsoft Excel Programming 2 24th Dec 2009 01:14 PM
XL2002 - Help with Points in SeriesCollection Trevor Williams Microsoft Excel Programming 4 23rd Jan 2009 12:28 PM
Obtaining the value of an ActiveChart.SeriesCollection(1).Points(2) Greg Glynn Microsoft Excel Programming 7 11th May 2007 03:11 PM
Error message on Activechart.XYGroups =?Utf-8?B?U0hJUFA=?= Microsoft Excel Programming 3 12th Jan 2005 10:29 PM
Argument List Of ActiveChart.Location And ActiveChart.ChartType Mo Microsoft Excel Programming 2 1st Sep 2003 11:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:56 PM.