How to isolate cause of "Excel ran out of resources while attempting to calculate..." error

d0rian

Active Member
Joined
May 30, 2015
Messages
313
Office Version
  1. 365
My file has grown in size to ~30MB, but I've optimized it whenever possible (e.g. hardcoding data after formulas calculate, etc). I used to get this error message -- below -- once every few months, but now I get it nearly every day when running the same VBA that I've used for years. I use Excel 2007. Any tips for figuring out exactly what's causing it? Observations:
  • There's no rhyme nor reason for which VBA triggers it (I have ~5 macros that I run one after another...and this error can occur during any of them.)
  • I've noticed that when I get this error, I need to close Excel completely and re-open it (after which I can run the macros without problem.) It's not good enough to just close *that particular workbook*...if I do that (while leaving the Excel program open), I'm 100% guaranteed to get the error with the first VBA I run. I need to exit Excel completely and then re-open to stand a chance of running them without error.
resources.JPG
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Some random suggestions:

Make sure you don't have any other memory hogging programs running. (I'm looking at you, Chrome browser).

Try saving it as an .xlsb file and see if that makes any difference.

Have you tried a code cleaner? VBA accumulates "garbage" over time. Here is an excellent free one:


The proviso is that it only works on 32-bit Excel versions. so you should be good to go with Excel 2007. I have a couple of large workbooks w/macros that I have to do this regularly on to keep them happy. I hope I don't need to say that you should run the code cleaner on a copy the first time you use it.

Lastly, and the one you probably don't want to hear, is upgrade to a 64-bit version of Excel which can access a lot more memory, assuming you have it on your PC.​
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,334
Members
449,077
Latest member
Jocksteriom

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