Originally, I opened a workbook, and wrote everything to it, and then did a 'saveas' at the end. But it would never finish, it kept blowing for memory.
The change I made was to put each section into a {} block, where I first do a 'create' and right before the } I do a 'save as'. I then dispose it. Now it runs fine and has no memory issues.
Building the sheets takes 60 to 80 minutes depending on a few variables. This step takes very little memory now.
Merging the sheets takes 2 to 3 hours. This step takes a LOT of memory, and I am worried that as business grows, it could be an issue. I really need to find a better way to merge the sheets.
But then I have to merge them all at the end. At least now I can get the job done, and the user is happy with the ending results, they are just not happy with the time.
These worksheets are really ridiculous in size, but people making 3 times my salary are making those decisions, so they are smarter than me, right? <sarcasm>