Arne,
Yes, there is, and it's quite simple also!
Use the Open statement to open your file, e.g.
Open "Path and file name" for Input As #1
Use the Line input statement to get a whole line:
Line Input #1, variable
reads the line text into variable. Next time you execute you get the next
line.
Use Input Function to get a specified number of caharacters:
variable = Input (x, #1)
reads x characters into variable. Next time you execute you get the next x
characters (or a different number).
If you want to read the whole file line by line, use a Do loop with an end
of file condition:
Do Until EOF(1)
Line Input #1, ....
....
Loop
Don't forget to close the file when done!
Close #1
You can open more files simultaneously, just assign different # numbers, and
address by each by its number.
Have a look in VBA help for the statements above, it helps.
HTH,
Nikos
Arne said:
Suppose I want to strore certain settings which are used in an add-in in a
text file. Is there a way to access the data in this text file directly
using VBA?