How to add a trendline to a series in Excel using vb.net

S

Sandeep

Hi,

I am trying to do charting in Excel using vb.net.
There, I am not able to access the Trendlines collection
of a series.

dim aSeries as Excel.Series
aSeries = CType(Excel.SeriesCollection(0), Excel.Series)

### Actually Excel says that Series should have a
Trenlines as collection and to that I can add a trendline.

But aSeries object obtained above does not have a
Trendlines collection.

Help, how to add a new trendline to the collection of
trendlines of a series.


Thx
Sandeep
 
J

Jon Peltier

Sandeep -

I don't know yet how to do the VB.Net end of it. But a Series has a
Trendlines collection, provided there are any trendlines at all. To add
a trendline in VBA you'd say

ActiveChart.Seriescollection(1).Trendlines.Add [parameter list]

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top