On Oct 12, 12:54*pm, OldDog <mikef2...@xxxxxx> wrote:
Quote:
> On Oct 12, 11:22*am, "Kiron" <Ki...@xxxxxx> wrote:
>
>
>
>
>> Quote:
> > Add(Type, Order, Period, Forward, Backward, Intercept, DisplayEquation,DisplayRSquared, Name)
> Quote:
> > Need to add empty parenthesis to Trendlines though.
> Quote:
> > To call the method with all its arguments set the Order and Period to 2, they're the default anyway and 0 or $null won't work, but the Type could be set as xlPolynomial, you'd have to correct that like this:
> > # mind word wrap
> > $serie1Trend1 = $ac.SeriesCollection(1).Trendlines().Add(-4132,2,2,0,0,0,$True,$True,'Serie**1Trend1')
> > $serie1Trend1.type = -4132
> Quote:
> > # or, create the trendline as xlLinear -default- and then
> > # adjust its properties
> > $serie1Trend1 = $ac.SeriesCollection(1).Trendlines().Add()
> > $serie1Trend1.DisplayEquation = $true
> > $serie1Trend1.DisplayRSquared = $true
> > $serie1Trend1.Name = 'myTL'
> Quote:
> > # another option
> > $serie1Trend1 = $ac.SeriesCollection(1).Trendlines().Add()
> > $serie1Trend1 | % {
> > *$_.DisplayEquation = $true
> > *$_.DisplayRSquared = $true
> > *$_.Name = 'myTL'
>>>
> Not that i doubt you, but I think you are doing some VooDoo here. If i
> run this script up to the point of the error and then do a get
> methedod, i get;
>
> PS C:\files\xls> $ac.SeriesCollection(2).Trendlines | gm
>
> * *TypeName: System.Management.Automation.PSMethod
>
> Name * * * * * * * * * *MemberType Definition
> ---- * * * * * * * * * *---------- ----------
> Copy * * * * * * * * * *Method
> System.Management.Automation.PSMemberInfo Copy()
> Equals * * * * * * * * *Method * * System.Boolean Equals(Object obj)
> GetHashCode * * * * * * Method * * System.Int32 GetHashCode()
> GetType * * * * * * * * Method * * System.Type GetType()
> get_IsInstance * * * * *Method * * System.Boolean get_IsInstance()
> get_MemberType * * * * *Method
> System.Management.Automation.PSMemberTypes get_MemberType()
> get_Name * * * * * * * *Method * * System.String get_Name()
> get_OverloadDefinitions Method
> System.Collections.ObjectModel.Collection`1[[System.String, mscorlib,
> Version=2.0...
> get_TypeNameOfValue * * Method * * System.String get_TypeNameOfValue()
> get_Value * * * * * * * Method * * System.Object get_Value()
> Invoke * * * * * * * * *Method * * System.Object Invoke(Params
> Object[] arguments)
> set_Value * * * * * * * Method * * System.Void set_Value(Object value)
> ToString * * * * * * * *Method * * System.String ToString()
> IsInstance * * * * * * *Property * System.Boolean IsInstance {get;}
> MemberType * * * * * * *Property
> System.Management.Automation.PSMemberTypes MemberType {get;}
> Name * * * * * * * * * *Property * System.String Name {get;}
> OverloadDefinitions * * Property
> System.Collections.ObjectModel.Collection`1[[System.String, mscorlib,
> Version=2.0...
> TypeNameOfValue * * * * Property * System.String TypeNameOfValue
> {get;}
> Value * * * * * * * * * Property * System.Object Value {get;set;}
>
> There is No Add mehtod there.
>
> So how did you get that method?
>
> OldDog- Hide quoted text -
>
> - Show quoted text - And by the way, adding () after Trendlines seems to fix the code.
$ac.SeriesCollection(1).Trendlines().Add(-4132,0,0,0,$true,$True)