+ Reply to Thread
Results 1 to 7 of 7

Out of Memory condition

  1. #1
    Registered User
    Join Date
    06-08-2017
    Location
    NJ, USA
    MS-Off Ver
    2016
    Posts
    13

    Out of Memory condition

    Hello... I have a workbook with 5 tabs, none of which have a significant amount of data (less than 50 rows/10 columns in all but 1, which has about 121,000 rows and 2 columns). There is also 1 form.

    The functionality in the workbook has been spot on, but when I add a process to remove items from a blacklist (hard coded for now), I get the Out of Memory error. When I comment it out, everything works fine. Uncomment, and every macro results in the error. I don't see anything egregious here, but maybe one of you has a better idea?

    Please Login or Register  to view this content.
    Thanks for having a look.

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

    Re: Out of Memory condition

    Which sheet has 121,000 rows? Not overwhelming, but that is certainly significant. Is that the Output sheet?

    One thing I would change, although I do not believe it is causing your problem, is change Integer to Long.

    I would also try the native VBA method Find rather than a worksheet function.

    These are speculative since I don't see what is actually causing your problem.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-08-2017
    Location
    NJ, USA
    MS-Off Ver
    2016
    Posts
    13

    Re: Out of Memory condition

    Thanks for the reply...

    The sheet with 121,000 rows is the BLACKLIST sheet. Essentially, I need to remove any rows from OUTPUT where a value in that row exists in the BLACKLIST sheet. So if the value in C10 exists on BLACKLIST, anywhere in Column A, I want to delete it from the sheet.

    I was thinking about doing a countif formula in the spreadsheet, then removing anything > 0 but that takes a bit longer.

    I tried the change above but am still getting the out of memory. It's weird though ... even if I run a DIFFERENT macro, I get the out of memory. But if I comment the code above, everything works fine.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Out of Memory condition

    Guessing it's because the maximum value of an integer variable is 32,767.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    06-08-2017
    Location
    NJ, USA
    MS-Off Ver
    2016
    Posts
    13

    Re: Out of Memory condition

    Thank you - I was getting the same thing when I changed it to LONG... I also tried defining the range as variant with no luck.

  6. #6
    Registered User
    Join Date
    06-08-2017
    Location
    NJ, USA
    MS-Off Ver
    2016
    Posts
    13

    Re: Out of Memory condition

    I just noticed something else ... when I closed Excel and reopened the file, the VBA editor was showing me my current project as well as one I had opened earlier today. In Task Manager, I saw 3 instances of "excel mashup evaluation container". I killed those and it's working fine again.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Out of Memory condition

    When you get an Out Of Memory error, sometimes it's because something is wrong in Excel but sometimes it's because you are actually out of memory. When that happens, Task Manager is a good first stop to see what using your system's memory, and look for anything unexpected.

+ 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. "Out Of Memory Error" when not out of memory
    By JEllisDesign in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-21-2019, 06:26 PM
  2. Excel/VBA/ADO - Import - use up memory and won't release used memory after import
    By Thomas Gram in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-07-2019, 06:55 AM
  3. [SOLVED] Rotate List of names bottom to top Repeat without condition with option to set a condition
    By spyac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-05-2018, 05:17 PM
  4. [SOLVED] Thrashing VBA Memory Leaks. Memory Loop Problems. Uncleared Memory in .Match Range Object
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2017, 05:17 PM
  5. Replies: 1
    Last Post: 12-08-2011, 08:52 AM
  6. Need VBA to find out memory and virtual memory used by thread
    By Yozhik in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2011, 08:31 AM
  7. Out of Memory:Is there any way in which I can restore the memory that got used up dur
    By c.vaibhav in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2009, 07:15 AM

Tags for this Thread

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