AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

I made an excel file and put my information in it (blocknames, distances, enz. ), then I call it from VBA and use it in AutoCAD, but also a possibility I heard is, to get the information out of an .txt file instead of an .xls file, this would save a little time so the routine is quicker.
Do you know have to call a .txt-file in VBA?

The following example will read from an external text file and populate a list box :

'CODING STARTS HERE

Sub FillListBox()

Dim sTemp As String

lstLayer.Clear

Open "C:\DATA\LAYERS.TXT" For Input As #1
While Not EOF(1)
Line Input #1, sTemp
lstLayer.AddItem sTemp
Wend

Close #1

End Sub

'CODING ENDS HERE

The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website