Page 1 of 1

gantt nexttask function generates runtime error 438

Posted: Mon Oct 22, 2007 11:36 am
by 6397093
Dear support team,


I've a problem with the "nexttask" function.

The following code is cut out from the manual but it doesn't work:
In German, the runtime error box reports: Objekt unterstützt diese Eigenschaft oder Methode nicht.

Is this a bug?

I've tried it with the latest version of teeChart, but the error is
still the same...


Here is the sourcecode:



Code: Select all

Private Sub Form_Load()
    fillChart
End Sub

Private Sub fillChart()
    Dim tmp1, tmp2 As Integer

    With TChart1.Series(0).asGantt
       .AddGantt DateValue("1,1,1997"), DateValue("31,1,1997"),2,"Hello"
       .AddGantt DateValue("1997,1,15"), DateValue("1997,2,15"),1,"Nice"
       .AddGantt DateValue("1997, 2,1"),DateValue("1997,2,28"),0,"World"
       .AddGantt DateValue("1997, 3, 1"), DateValue("1997, 3, 31"), 2,""
       .AddGantt DateValue("1997, 4, 1"), DateValue("1997, 4, 30"), 0,""
       .AddGantt DateValue("1997, 3, 15"), DateValue("1997, 4, 15"),1,""
       'change connecting lines

       .ConnectingPen.Width = 3
       .ConnectingPen.Color = vbBlue
       ' increase bar heights
       .Pointer.VerticalSize = 16
    End With


    With TChart1.Series(0).asGantt
tmp1=.AddGantt(DateValue("1,1,1997"),DateValue("31,1,1997"),2,"Development")
tmp2=.AddGantt(DateValue("1997,1,15"),DateValue("1997,2,15"),1,"Testing")
    End With
    TChart1.Series(0).asGantt.NextTask(tmp1) = tmp2  'Runtime Error 438
End Sub

Thanks for any help or idea


Manne

Posted: Mon Oct 22, 2007 2:03 pm
by narcis
Hi Manne,

Thanks for reporting. You should do this:

Code: Select all

    TChart1.Series(0).asGantt.NextTask.Value(tmp1) = tmp2
Could you please indicate where did you exactly found this code?

Thanks in advance!

Posted: Mon Oct 22, 2007 2:24 pm
by 6397093
Hello Narcis,

thanks a lot for your solution! I've spent hours of try and fail
to solve this problem.

The code sample is from the TeeChart 4.0.x online help (gantt)


greets


manne

Posted: Mon Oct 22, 2007 2:27 pm
by narcis
Hi manne,

Thanks for the information I've added this to our defect list to be fixed for next releases.