Memory and Macros?

Fooser

Board Regular
Joined
Sep 16, 2005
Messages
152
I have a question that maybe someone can answer. After executing some of my macros, excel tends to run much slower. Then every once in a while I get debug errors for standard short cut keys in excel. The problem is the programs I recieve debug errors work find when I actually execute them.

Question:
Can a macro still reside in memory after it has been executed? If so, is there a way or command I can use in my scripts to completely remove them from memory after executing?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi Fooser,

Very good question, and one I haven't seen before! I do know that Excel does retain macro data in memory after completion because I know that all Public and Static variable values are retained between runs. Upon a little investigation I find that placing an End statement in your code (at the end, of course) will free up all module-level variables and all static local variables in all modules. But if you have any objects that use the Unload, QueryUnload, or Terminate events you should first add the appropriate Unload statements to "gracefully" complete them.
 
Upvote 0
Thanks for the info on how memory is stored.

I think the true problem is how excel is designed. I know when I have excel open too long and have been using some memory intesive spreadsheets along with macros I tend to crash unless I restart excel ocassionally.

I think I might be running into the limits of excel and how it can handle memory. I know from past experience excel is limited to 64mb of memory per occurance, which means any excel occurance over 30000 rows with referene formulas may crash. Since I have been dealing with 25000-45000 row data files, which I'm extracting into excel to work with, I sometimes have problems calculating formulas or running macros smoothly.

More then likely I will have to switch to Acess or some other database program to import these files for manipulation.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,937
Members
449,094
Latest member
teemeren

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