super simple.

super simple.

Anonymous
Not applicable
227 Views
2 Replies
Message 1 of 3

super simple.

Anonymous
Not applicable
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!
0 Likes
228 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
What is the error you get?

Can you post the entire code (so I can run it here without attempting to
duplicate what you are doing)?

"kemp" wrote in message news:5437476@discussion.autodesk.com...
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.
0 Likes
Message 3 of 3

Anonymous
Not applicable
I must have made some typographical error, it now works, and I can't see
any difference. Thanks for the offer though!

Jeff Mishler wrote:
> What is the error you get?
>
> Can you post the entire code (so I can run it here without attempting to
> duplicate what you are doing)?
>
> "kemp" wrote in message news:5437476@discussion.autodesk.com...
> 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.
0 Likes