I am using MS Access 365 (2013) and are having run-time errors on even the most simple calls to object methods on the ActiveGanttVCCtl object.
Using the supplied 'Getting started' guide on the ActiveGantt website (http://www.sourcecodestore.com/Article.aspx?ID=15#Create3), I am receiving a run-time error (424 Object Required) on any one of the four lines of code following the for loop. The code is supplied here again for convenience.
Option Compare Database
Option Explicit
Public Function ActiveGanttVCCtl1() As ActiveGanttVCCtl
Set ActiveGanttVCCtl1 = ActiveGanttVCCtl1A.Object
End Function
Private Sub Form_Load()
Dim i As Integer
ActiveGanttVCCtl1.Columns.Add "Column 1", "", 125, ""
ActiveGanttVCCtl1.Columns.Add "Column 2", "", 100, ""
For i = 1 To 10
ActiveGanttVCCtl1.Rows.Add "K" & i, "Row " & i, True, True, ""
Next
ActiveGanttVCCtl1.CurrentViewObject.TimeLine.Position DateSerial(2011, 11, 2)
ActiveGanttVCCtl1.Tasks.Add "Task 1", "K1", DateSerial(2011, 11, 2) + TimeSerial(0, 0, 0), DateSerial(2011, 11, 2) + TimeSerial(3, 0, 0), "", "", ""
ActiveGanttVCCtl1.Tasks.Add "Task 2", "K2", DateSerial(2011, 11, 2) + TimeSerial(1, 0, 0), DateSerial(2011, 11, 2) + TimeSerial(4, 0, 0), "", "", ""
ActiveGanttVCCtl1.Tasks.Add "Task 3", "K3", DateSerial(2011, 11, 2) + TimeSerial(2, 0, 0), DateSerial(2011, 11, 2) + TimeSerial(5, 0, 0), "", "", ""
End Sub
Please note that the error does not occur until the line
ActiveGanttVCCtl1.CurrentViewObject.TimeLine.Position DateSerial(2011, 11, 2)
The reference to the ActiveGanttVC Scheduler Component library has been included (it would given a compile error otherwise) and an ActiveGantt ActiveX control exists on the form named ActiveGanttVCCtl1A. I have also tried declaring the ActiveGanttVCCtl object within the Form_Load() function itself rather than in a separate function but get the same result.
I have also determined that at the point of the run-time error, I am able to access the ActiveGanttVCCtl1.CurrentViewObject.TimeLine object as I can run the GetXML method on it without any problems, just not the Position method.
I have tried also commenting this particular line out, however I receive the same run-time error on the next line of code (the call to tasks.add). Creating further calls to the columns.add or rows.add methods, however, still appears to work fine at this position in the code.
Is it possible that there are issues in MS Access 2013 that do not appear in MS Access 2010 for this control?