misaghah007
Technical User
Hello and Good day,
Public Const R = 11
Public Const P = 37
Public Const row = 1 + R + P
Public traveltime(row, row) As Double
If optKuah.Value = True Then
"C:\Users\Acer E1\Desktop\AimiSarah\Dissertation_Langkawi\Langkawi with checkBox\vb_original\kuah_time.txt " For Input As #2
Else
Open "C:\Users\Acer E1\Desktop\AimiSarah\Dissertation_Langkawi\Langkawi with checkBox\vb_original\time.txt" For Input As #2
End If
'assign travel time to an array
For i = 0 To row - 1
For j = 0 To row - 1
Input #2, traveltime(i, j)
Next j
Next i
close #2
Coding above shows run time error 62, input past end of files when I run it.the input files of kuah_time.txt and time.txt, both have data of 49*49.
which means, time for each location from 49 places.
The error won't appears if I only use on file.
However, when I added if..else.. to choose which file to carry out, it displays error 62.
kindly advise on how I can rectify it?
Thanks
Public Const R = 11
Public Const P = 37
Public Const row = 1 + R + P
Public traveltime(row, row) As Double
If optKuah.Value = True Then
"C:\Users\Acer E1\Desktop\AimiSarah\Dissertation_Langkawi\Langkawi with checkBox\vb_original\kuah_time.txt " For Input As #2
Else
Open "C:\Users\Acer E1\Desktop\AimiSarah\Dissertation_Langkawi\Langkawi with checkBox\vb_original\time.txt" For Input As #2
End If
'assign travel time to an array
For i = 0 To row - 1
For j = 0 To row - 1
Input #2, traveltime(i, j)
Next j
Next i
close #2
Coding above shows run time error 62, input past end of files when I run it.the input files of kuah_time.txt and time.txt, both have data of 49*49.
which means, time for each location from 49 places.
The error won't appears if I only use on file.
However, when I added if..else.. to choose which file to carry out, it displays error 62.
kindly advise on how I can rectify it?
Thanks