STACKS !!!

selkov

Well-known Member
Joined
Jan 26, 2004
Messages
787
I am running a macro that opens 5 workbooks & updates a sixth. It pulls differnt information each time & saves 400 copies one at a time under variable names. Every 130 or so I get a stack overflow error. Already increased the Stacks in .cng. What else can I do?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hello selkov,

Do I correctly understand that your macro creates 400 different workbooks? If so, does it close each workbook after saving it so that you aren't trying to have 400 workbooks open at one time?

Damon
 
Upvote 0
I am opening 5 workbooks & gathering some information to a sixth. None are larger than 2 meg. I am saving the sixth under a new name (generated from within the spreadsheets) closing it, and starting again.
There are never more than 6 open.
 
Upvote 0
Hi selkov,

So if I understand correctly, the macro is saving the 6th file 400 times.

This is probably more in the category of a workaround than it is a solution, but if you run your macro using Automation (i.e., CreateObject, etc.) you could get the macro to close and restart Excel every 100 saves so that you don't have to do this manually. You might find that you have to run the macro in another application (e.g., VB6, Word, PowerPoint) to do this.

Damon
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top