|
-
May 18th, 2010, 08:08 PM
#1
Thread Starter
Addicted Member
[RESOLVED] read from text file and write in list view
Hi i have text file like this
Date Test,Time Test,Test Time,Varient,SN,Model,Both Hand - DMM,STATUS
5/14/2010,11:05:00 PM,35,20367,SAB34N10051009252,X134,21.000,PASS,
I want write this to the list view. This is my code so far
Code:
Private Sub ReadFile()
Set fso = New FileSystemObject
sFile = data_name2 & name1 & ".txt"
Set oTSRead = fso.OpenTextFile(sFile, ForReading, False)
If oTSRead.Line > 0 Then
Do While Not oTSRead.AtEndOfStream
'Get the next line in our file
sLine = oTSRead.ReadLine
strField() = Split(sLine, ",")
If strField(0) = "Date" Then GoTo skip1:
If Left((cboSpec.Text), 4) = "X134" Then
lv5.ListItems.Add 1, , ""
lv5.ListItems(1).Text = strField(0)
For q = 1 To 33
lv5.ListItems(1).SubItems(q) = strField(q) Next
End If
counter = counter + 1
skip1:
Loop
End If
oTSRead.Close
lblno.Caption = counter
txtSN.SetFocus
End Sub
but i got invalid property value error at line that i highlighted. Can any one help me to solve this problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|