Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POLYNOMIAL TRENDLINE

Status
Not open for further replies.

IANGRAND

Technical User
Jul 29, 2003
92
GB
I have the following code to add a trendline to a graph in Microsoft Access.

Dim GraphObj As Object
Set GraphObj = Me![Graph45].Object.Application.Chart
GraphObj.SeriesCollection(1).TrendLines.Add
GraphObj.SeriesCollection(1).TrendLines(1).Type = 1


However i require a polynomial trendline. Does anyone have anycode to create the trendline

Cheers

Ian
 
Try
GraphObj.SeriesCollection(1).TrendLines(1).Type = xlPolynomial

xlLinear give linear
xlMovingAvg give moving average

dyarwood
 
No joy im afraid, using the code causes the following error:

Unable to set the type property of the Trendline Class
 
Try this with your setting as required, beginning at Trendlines as above

Trendlines.Add(Type:=xlPolynomial, Order:=2 _
, Forward:=0, Backward:=0

Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top