Macro to clear Memory

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,586
Office Version
  1. 2021
Platform
  1. Windows
From time to time I have a macro to open up several workbooks and to run a macro to update these workbooks


Unfortunately, it uses a lot of RAM and occasionally the workbooks freeze and I need to close down Excel and restart Excel and re-run the macro


I would like to know if there is VBA code to clear the RAM after the macro has done what it is supposed to do.


If so kindly provide me with code to do so. If not is the any commercial software or freeware that can clear unused RAM ?
 
must I put the code after end sub or before end sub ?
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I get user defined type not defined ...
You need to set a reference to Microsoft Forms Object Library: Tools > References ...., or add a userform, which you can then immediately delete.
 
Upvote 0
Thanks for your input


I am not that familiar with the Microsoft Forms Object Library

Please advise which items within the library I would need to select (Using office 2016)
 
Upvote 0

Forum statistics

Threads
1,221,550
Messages
6,160,459
Members
451,647
Latest member
Tdeulkar

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