pdb78,

inputfile is a string value, not a counter. You are using the Dir() method, which returns a string value of the next file in the directory. When there are no more files in the directory, Dir returns a length 0 string (or vbNullString). When that happens, the loop stops because it has reached the end of the list of files.

As to your second issue, I don't really have an answer, sorry