Hi!
Im trying to create a really really simple way of reading a textfile into a listview. Almost there but I have a problem...
I ahve looked through on the net and this was the simplest way of reading a textfile into a listview in separate columns.
PRoblem is that when running this code, I ALWAYS run into RUMTIME ERROR 424.. OBJECT NEEDED.. I stepped thorugh the code and it's when I try the, lvwInfo.ListItems.Clear if take aways taht the code stops at: lvwInfo.ListItems.Add
Either it's me or I always find it hard to work with the listview control.. It like it's trying to tell me your not good enough to have me in your programs...
Anyone got a solution?
Thanks!
Im trying to create a really really simple way of reading a textfile into a listview. Almost there but I have a problem...
I ahve looked through on the net and this was the simplest way of reading a textfile into a listview in separate columns.
PRoblem is that when running this code, I ALWAYS run into RUMTIME ERROR 424.. OBJECT NEEDED.. I stepped thorugh the code and it's when I try the, lvwInfo.ListItems.Clear if take aways taht the code stops at: lvwInfo.ListItems.Add
Either it's me or I always find it hard to work with the listview control.. It like it's trying to tell me your not good enough to have me in your programs...
Anyone got a solution?
Thanks!
Code:
Sub readlogfile2(logfilename, page)
Dim filepath As String
Dim lvItems As ListItem
Dim date1, loggen As String
filepath = logfilename & ".ini"
lvwInfo.ListItems.Clear
Open filepath For Input As #1
Do While Not EOF(1)
Input #1, name1, address1
Set lvItems = lvwInfo.ListItems.Add
lvItems.Text = date1
lvItems.SubItems(1) = loggen
Loop
Close #1
End Sub