Constantly getting "Out of memory" messages when VBA window is open

6StringJazzer

Well-known Member
Joined
Jan 27, 2010
Messages
3,658
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Cross-posted at
Excel Forum
Microsoft Community

For quite some time I have been getting pop-up dialogs that say "Out of memory" when I am using Excel. The system memory utilization is typically around 50% when this happens. I have 32G of physical memory.

These messages typically occur after I have been using Excel for a while. It doesn't seem to matter how many files I have open; it happens if only one file is open. However, once it starts, it only happens when the VBA development window is open, and happens immediately after any action on worksheet, even selecting another cell. It does not happen when VBA code is actually running. Closing the VBA window causes the messages to stop, until the next time I open it.

I have been working around it but it's time to solve it. I have found no clues in searches since most of them recommend reducing memory usage or adding more physical memory. But there is 16G of headroom, so this should not be an issue.

Currently on MS 365 Home & Family, Version 2402, Build 17328. 20184, Current Channel.
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I've seen it happen. Usually when I've had lots of worksheets open and the VBE window is open and I'm doing a lot of code testing. Recently I was working on some code that would open a temporary worksheet, do stuff, then be deleted. That creation/deletion cycle seemed ot bring on the out of memeory warning faster than normal. For me, the only way to get rid of it is to completely exit Excel and then relaunch. My current theory is that it has to do with the Excel application's garbage collection. MS has been notoriously poor at that over the years, IMHO.
 
Upvote 0
the only way to get rid of it is to completely exit Excel and then relaunch
That works until it starts again the next time. Also closing the VBA window works, as long as that window stays closed.
 
Upvote 0
As an example, it's happening right now. Excel has four files open, and Task Manager shows Excel is using only 137MB of memory.
 
Upvote 0
As an example, it's happening right now. Excel has four files open, and Task Manager shows Excel is using only 137MB of memory.
Yeah, but I suspect the message is referring to a more specific category of memory - like stack space, for example.
 
Upvote 0
Maybe this helps. See also the provided link on this page

 
Upvote 0
Yeah, but I suspect the message is referring to a more specific category of memory - like stack space, for example.
It would be odd to get a stack space fault where there is no code running.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

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