Message 1 of 3
super simple.

Not applicable
12-29-2006
09:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can someone tell me why the following does not work? It fails at the
"Open" line due to the portion "ListBox1.List(i)" I think it has
something to do with this not being considered a string, but I can't
seem to make it work using my limited vba knowledge and trying to dim it
as a string.
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
fh = FreeFile
Open ("S:\CAD-Setup\Lisp-Routines\Layer Sets\" & ListBox1.List(i) &
".csv") For Input As #fh
Do While Not EOF(fh)
Line Input #fh, tmp
ListBox2.AddItem tmp
Loop
Close fh
End If
Next i
your help is greatly appreciated!
"Open" line due to the portion "ListBox1.List(i)" I think it has
something to do with this not being considered a string, but I can't
seem to make it work using my limited vba knowledge and trying to dim it
as a string.
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
fh = FreeFile
Open ("S:\CAD-Setup\Lisp-Routines\Layer Sets\" & ListBox1.List(i) &
".csv") For Input As #fh
Do While Not EOF(fh)
Line Input #fh, tmp
ListBox2.AddItem tmp
Loop
Close fh
End If
Next i
your help is greatly appreciated!