I'd say compile to x64 and create the file directly without the two steps.
Another thing that doesn't make sense is why would it run out of memory when you're creating a file with 200 sheets and not when you're copying 200 sheets. It doesn't make sense.
Another thing that doesn't make sense is why would it run out of memory when you're creating a file with 200 sheets and not when you're copying 200 sheets. It doesn't make sense.