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

d0rian

Active Member
Joined
May 30, 2015
Messages
299
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

rlv01

Well-known Member
Joined
May 16, 2017
Messages
1,174
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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.​
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,697
Messages
5,765,977
Members
425,320
Latest member
Galin

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