Macro to clear Memory

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,592
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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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,223,725
Messages
6,174,134
Members
452,546
Latest member
Rafafa

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