VB Program will only runs correctly some of the time

I have a vb program that reads a number of files with differnt names and processes each file to add a header.

the program works great BUT the only problem is it sometimes misses the last file unless I place a msgbox in the code to be clicked.  It like the program needs to refocus to pick up the last file.

Does anyone have any ideas.

Who is Participating?

Improve company productivity with a Business Account.Sign Up

ClifConnect With a Mentor Commented:
Use DoEvents after processing each file.  This will allow your app to "catch it's breath".
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.