Weird VBA problems. Out of memory. F8 step through failing. crashing...

hellfire45

Active Member
Joined
Jun 7, 2014
Messages
464
Hi guys. I did google this, at length, and found the answers not that helpful. Just FYI. ;)


I have a vba module thats about 28 pages long.
There are 5 of these modules.
Each module has around 100 declared variables.

I need to add more. About 10 more to each.

When I try to add more using
Code:
Dim xyx as integer
For example, Excel says "out of memory" and then usually crashes.

Also then the F8 "step through" isn't working. It just decides to run all the code.


Why is this happening? I have MUCH larger processes that do not do this.

Any suggestions? I work for a corporation and don't really have the ability to increase my RAM or mess with registry files. All that stuff is locked down.

Thanks! I can post the code if you want but I figured 28 pages is not ideal.
 
I did say it was unproven. was just thinking if all your modules contain the Dim, then it might be more memory friendly, but I don't know. Also a Global way was not quite saying declare as Global, it was my intention but stated wrongly
 
Last edited:
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
It also doesn't help that excel just keeps crashing. I split the variables up like as seen below but excel pretty much crashes every time I hit F8 to begin the step through process. Would this happen if the module was too large?
 
Upvote 0
So my problem still persists. So I checked the .bas file size for each module; 65,62,62,67,51

This potentially might be an issue based on the prior statement about the 64kb cap however, I have a much larger automation that I was pretty sure had some long modules. So I exported one of those I felt is the largest and that automation has a module that is 417kb. That automation never crashes ever. It always runs well.

So considering my 417kb module is good to go, I really don't feel too strongly about the 64kb cap.

Thoughts?
 
Upvote 0
file size is sometimes dependant on where it is viewed, the base formatting of a disk from 4Kb to 256K etc. Time consuming but does
F8 step through complete
Run on another PC
64 or 32 bit environment
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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