What objects are you creating to handle a record? What happens to these objects after the record is written? Where is the output being written? Where is the data coming from? If from a database, perhaps it is your handling of result sets that is causing the problem, not the writing. What happens if you just retrieve the records but dont try to write the excel file?
Bill
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
a bit of art, as a gift, the permaculture playing cards