Sub LoadTable(Dir As String, FileName As String)
Dim workbook1 As ReadableWorkbook
Dim TodoSheet As ReadableSheet
workbook1.Initialize(Dir, FileName)
TodoSheet = workbook1.GetSheet(0)
If table1.IsInitialized Then
Activity.RemoveAllViews 'remove the current table
End If
table1.Initialize(Me, "Table1", 5) 'The last value here sets the number of columns in the table that shows on the screen.
table1.AddToActivity(Activity, 0, 0, 100%x, 100%y)
Log("TodoSheet.RowsCount = "&TodoSheet.RowsCount)
For row = 0 To TodoSheet.RowsCount - 1
'Dim values(5) As String
coll = 0
For i = 0 To 17 'i is the column number. values.Length is from the Dim values(6) line a few lines up.
If i = 1 Or i = 2 Or i = 5 Or i = 6 Or i = 17 Then
coll = coll + 1
Todos(coll,row) = TodoSheet.GetCellValue(i, row)
If i = 1 And Todos(coll,row) = "" Then
LastTodo = i
Exit
End If
End If
Next
Next