In your WriteFile() function you do not have a NEXT to increment yopur "For each" loop. Then you immediately close the output file.

Strings are not limited to 32K as the docs states. You can put 400MB of data into a string variable.
_________________________
Home page: http://www.kixhelp.com/hb/