You could perhaps concentrate on getting the gui-method (or macro) to work - it is quicker and easier to test than the coded version. Once you've achieved this then you'll know that the coded version can be made to work, and you will be more aware of the issues involved.
Sounds like a plan. I have 69 total fields (not including the ID field) all set as Text - 255 characters. When I deleted down to only having 11 fields at 255 characters, the gui-export worked!?
After reading through some of these links I'm starting to get the suspicion there are dBase field length/file size limits I am unaware of: