+ Reply to Thread
Results 1 to 5 of 5

Macro to clear memory Cache

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Macro to clear memory Cache

    I have a macro to import data and perform various other things

    However if I run a second macro to find and replace various data , it cannot perform. I then Close Excel and then run this macro and it does what it needs to do

    The reason for it not running after running the first macro it that there is not enough memory (I have 16 GB of Ram use an I7 3.6 GHZ Processor)

    I am look for code that will clear the Memory cashe and allow me to run the second macro without having to close Excel


    I have tried using the code below at the end of my code to free up memory but it does not clear the memory cashe

    Please Login or Register  to view this content.

    It would be appreciated if someone could assist me
    Last edited by 6StringJazzer; 06-23-2021 at 11:03 PM. Reason: fixed closing code tag

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,970

    Re: Macro to clear memory Cache

    First, why do you think that memory is the problem? Windows memory caching is a very low-level process and I don't think you can do anything about it in VBA. And I doubt this is your problem.

    However, you may have other problems we need to look at, like effective memory management in your first macro. Please post your code (use CODE tags).

    The code you showed here just puts the null string in the clipboard. The clipboard is almost certainly not using 16GB of memory.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Re: Macro to clear memory Cache

    Thanks for the reply

    See my first macro which combines several macros


    Please Login or Register  to view this content.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,970

    Re: Macro to clear memory Cache

    This code isn't doing anything that leaves anything in memory. What exactly happens here: "it cannot perform"? What do you expect and what actually happens? Do you get an error message?

  5. #5
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,873

    Re: Macro to clear memory Cache

    When I run a seperate Macro to Replace Space between numbers, I won't do this. I then close Excel, then open the workbook and the macro runs perfectly.

    I am not sure why this does this

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pivot table Cache clear
    By magnus101 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-25-2024, 02:06 AM
  2. [SOLVED] Macro to update pivot tables and use the SAME cache instead of repeatedly recreating cache
    By Fowzee1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2015, 11:26 PM
  3. Unable to clear pivot cache without reopening the workbook
    By hcyeap in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2015, 05:45 AM
  4. VBA Code to Clear Cache
    By VB Nubie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2014, 03:19 PM
  5. Loops - Clear cache/memory problem
    By Jovica in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2013, 10:23 AM
  6. How to clear memory while running a macro
    By Hjahren in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2010, 10:04 AM
  7. clear cache to reduce sheet recalc time
    By pacificwaters in forum Excel General
    Replies: 3
    Last Post: 08-16-2008, 12:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1