STACKS !!!

selkov

Well-known Member
Joined
Jan 26, 2004
Messages
781
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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
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
 

selkov

Well-known Member
Joined
Jan 26, 2004
Messages
781
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.
 

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,159
Messages
5,768,523
Members
425,479
Latest member
Neerajcool

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
Top