请大大们看看,出了什么问题
Private Sub fn_Open_Click()Dim I As Long, b As String, a() As String
CommonDialog1.ShowOpen 'Show file Open Dialog
fn = CommonDialog1.FileName 'Get the Chosen File Name
If fn = "" Then Exit Sub 'Make Sure User have selected a file
Form1.ListView1.ListItems.Clear
Open fn For Input As #1
For I = 1 To GetCountRow(fn)
ReDim a(3)
Input #1, b
a = Split(b, ",")
ListView1.ListItems.add , "", I
ListView1.ListItems(I).SubItems(1) = a(0)
ListView1.ListItems(I).SubItems(2) = a(1)
ListView1.ListItems(I).SubItems(3) = a(2)
ListView1.ListItems(I).SubItems(4) = a(3)
ListView1.ListItems(I).SubItems(5) = "1"
DoEvents
Next
End Sub
这是我编的一D代码,文件中的数据是
"5637438","531","179","500"
"5637438","613","169","500"
...
"5637438","454","243","500"
现在我把数取出来放到listview1中,为什么到了ListView1.ListItems(I).SubItems(2) = a(1)
出现下标越界
请指教,能够给出完成的代码更好