Hello, I am new to coding in VB. I need to write a program which inputs several files. Since, I have more than 200 files - I would like the program to automatically open, process the file (I have this part written) and close each file and then complete the process for the remaining files. The files are .dat files. Thanks for any help.

For sequential, repetitive tasks, use a loop.

File$ = Dir("*.DAT")
Do While File$ > ""
'Open and process file here
'Close File
File$ = Dir
Loop

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.